diff --git a/onnxruntime/core/providers/cuda/math/matmul_integer.cc b/onnxruntime/core/providers/cuda/math/matmul_integer.cc index c27a949ed2..e4547da039 100644 --- a/onnxruntime/core/providers/cuda/math/matmul_integer.cc +++ b/onnxruntime/core/providers/cuda/math/matmul_integer.cc @@ -128,7 +128,7 @@ Status MatMulInteger::ComputeInternal(OpKernelContext* ctx) cons b_pad_size, b_padded)); - for (int batch = 0; batch < helper.OutputOffsets().size(); batch++) { + for (size_t batch = 0; batch < helper.OutputOffsets().size(); batch++) { CUBLAS_RETURN_IF_ERROR(cublasGemmEx( Base::CublasHandle(), CUBLAS_OP_N, diff --git a/onnxruntime/core/providers/cuda/nn/conv.cc b/onnxruntime/core/providers/cuda/nn/conv.cc index 3c8c592baa..68b551a820 100644 --- a/onnxruntime/core/providers/cuda/nn/conv.cc +++ b/onnxruntime/core/providers/cuda/nn/conv.cc @@ -130,8 +130,7 @@ Status Conv::ComputeInternal(OpKernelContext* context) const { std::vector b_dims(2 + kernel_shape.size()); b_dims[0] = 1; // N b_dims[1] = b_shape[0]; // C - for (auto i = 0; i < kernel_shape.size(); i++) - b_dims[2 + i] = 1; + for (size_t i = 0; i < kernel_shape.size(); i++) b_dims[2 + i] = 1; ORT_RETURN_IF_ERROR(s_.b_tensor.Set(b_dims, CudnnTensor::GetDataType())); } @@ -229,7 +228,7 @@ Status CudnnConvolutionDescriptor::Set( std::vector pad_dims(rank); std::vector stride_dims(rank); std::vector dilation_dims(rank); - for (auto i = 0; i < rank; i++) { + for (size_t i = 0; i < rank; i++) { pad_dims[i] = gsl::narrow_cast(pads[i]); stride_dims[i] = gsl::narrow_cast(strides[i]); dilation_dims[i] = gsl::narrow_cast(dilations[i]); diff --git a/onnxruntime/core/providers/cuda/tensor/eye_like_impl.cu b/onnxruntime/core/providers/cuda/tensor/eye_like_impl.cu index a20d0ea5e0..8f1216e43c 100644 --- a/onnxruntime/core/providers/cuda/tensor/eye_like_impl.cu +++ b/onnxruntime/core/providers/cuda/tensor/eye_like_impl.cu @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#pragma once #include #include "core/providers/cuda/shared_inc/cuda_utils.h" #include "core/providers/cuda/cu_inc/common.cuh" diff --git a/onnxruntime/core/providers/cuda/tensor/quantize_linear.cu b/onnxruntime/core/providers/cuda/tensor/quantize_linear.cu index f380fa69f8..89f0e40dcc 100644 --- a/onnxruntime/core/providers/cuda/tensor/quantize_linear.cu +++ b/onnxruntime/core/providers/cuda/tensor/quantize_linear.cu @@ -42,7 +42,6 @@ Status CudaQuantizeLinear(const float* input, T* output, const float* scale, con return Status::OK(); int blocksPerGrid = static_cast(CeilDiv(num_of_element, GridDim::maxThreadsPerBlock * GridDim::maxElementsPerThread)); - CUDA_LONG N = static_cast(num_of_element); QuantizeLinearKernel <<>>( input, @@ -72,7 +71,6 @@ Status CudaDequantizeLinear(const T* input, float* output, const float* scale, c return Status::OK(); int blocksPerGrid = static_cast(CeilDiv(num_of_element, GridDim::maxThreadsPerBlock * GridDim::maxElementsPerThread)); - CUDA_LONG N = static_cast(num_of_element); DequantizeLinearKernel <<>>( input, diff --git a/onnxruntime/core/providers/cuda/tensor/where_impl.cu b/onnxruntime/core/providers/cuda/tensor/where_impl.cu index 6c7f92dcf7..7d02a21e62 100644 --- a/onnxruntime/core/providers/cuda/tensor/where_impl.cu +++ b/onnxruntime/core/providers/cuda/tensor/where_impl.cu @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#pragma once #include #include "core/providers/cuda/shared_inc/cuda_utils.h" #include "core/providers/cuda/cu_inc/common.cuh" diff --git a/onnxruntime/test/shared_lib/test_nontensor_types.cc b/onnxruntime/test/shared_lib/test_nontensor_types.cc index 8a1d125171..0c6f676805 100644 --- a/onnxruntime/test/shared_lib/test_nontensor_types.cc +++ b/onnxruntime/test/shared_lib/test_nontensor_types.cc @@ -36,7 +36,7 @@ TEST(CApiTest, CreateGetVectorOfMapsInt64Float) { // support zipmap output type std::vector keys{3, 1, 2, 0}; std::vector dims = {4}; std::vector values{3.0f, 1.0f, 2.f, 0.f}; - for (int i = 0; i < N; ++i) { + for (size_t i = 0; i < N; ++i) { // create key tensor Ort::Value keys_tensor = Ort::Value::CreateTensor(info, keys.data(), keys.size() * sizeof(int64_t), dims.data(), dims.size(), ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64); @@ -65,8 +65,8 @@ TEST(CApiTest, CreateGetVectorOfMapsInt64Float) { // support zipmap output type ASSERT_EQ(failed, true); // Fetch - for (int idx = 0; idx < N; ++idx) { - Ort::Value map_out = seq_ort.GetValue(idx, default_allocator.get()); + for (size_t idx = 0; idx < N; ++idx) { + Ort::Value map_out = seq_ort.GetValue(static_cast(idx), default_allocator.get()); // fetch the map // first fetch the keys @@ -97,7 +97,7 @@ TEST(CApiTest, CreateGetVectorOfMapsStringFloat) { // support zipmap output typ std::vector keys{keys_arr, keys_arr + NUM_KV_PAIRS}; std::vector dims = {NUM_KV_PAIRS}; std::vector values{3.0f, 1.0f, 2.f, 0.f}; - for (int i = 0; i < N; ++i) { + for (size_t i = 0; i < N; ++i) { // create key tensor Ort::Value keys_tensor = Ort::Value::CreateTensor(info, keys.data(), keys.size() * sizeof(std::string), dims.data(), dims.size(), ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING); @@ -118,8 +118,8 @@ TEST(CApiTest, CreateGetVectorOfMapsStringFloat) { // support zipmap output typ ASSERT_EQ(num_values, N); // Fetch - for (int idx = 0; idx < N; ++idx) { - Ort::Value map_out = seq_ort.GetValue(idx, default_allocator.get()); + for (size_t idx = 0; idx < N; ++idx) { + Ort::Value map_out = seq_ort.GetValue(static_cast(idx), default_allocator.get()); // fetch the map // first fetch the keys