diff --git a/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_matmul.cc b/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_matmul.cc index 34198b7b9fe7a..ad5bd1573f6cc 100644 --- a/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_matmul.cc +++ b/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_matmul.cc @@ -88,7 +88,7 @@ Status QOrderedMatMul::QOrderedMatMul::ComputeInternal(OpKernelContext* context) TensorShape output_shape(tensor_A.Shape()); output_shape[output_shape.NumDimensions() - 1] = cols_B; - const float zero = 0.0f; + constexpr float zero = 0.0f; const float* scale_C = &zero; const int8_t* C = nullptr; diff --git a/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_matmul_utils.cc b/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_matmul_utils.cc index 12021c99e6182..0c5199b484dd5 100644 --- a/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_matmul_utils.cc +++ b/onnxruntime/contrib_ops/cuda/quantization/qordered_ops/qordered_matmul_utils.cc @@ -147,7 +147,7 @@ Status QOrdered_MatMul(cublasLtHandle_t cublasLt_handle, cudaStream_t stream, cublasLtMatrixLayout_t desc_D = nullptr; auto clean_desc_D = gsl::finally([&desc_D]() {if (desc_D) cublasLtMatrixLayoutDestroy(desc_D); }); - const float beta_zero = 0.0f; + constexpr float beta_zero = 0.0f; beta = (C == nullptr ? &beta_zero : beta); CUBLAS_RETURN_IF_ERROR(cublasLtMatmulDescCreate(&matmul_desc, CUBLAS_COMPUTE_32I, CUDA_R_32F)); diff --git a/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.h b/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.h index c07324a8ac60a..048887c326de1 100644 --- a/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.h +++ b/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.h @@ -80,7 +80,7 @@ struct BinaryElementwisePreparation { auto offset = out_rank - lhs_rank; for (auto i = offset; i < out_rank; ++i) { // the stride for broadcast dimension is kept as 0 - if (lhs_shape.GetDims()[i - offset] != 1) { + if (lhs_shape.GetDims()[static_cast(i) - offset] != 1) { lhs_padded_strides[i] = original_lhs_padded_strides[i]; } } @@ -92,7 +92,7 @@ struct BinaryElementwisePreparation { auto offset = out_rank - rhs_rank; for (auto i = offset; i < out_rank; ++i) { // the stride for broadcast dimension is kept as 0 - if (rhs_shape.GetDims()[i - offset] != 1) { + if (rhs_shape.GetDims()[static_cast(i) - offset] != 1) { rhs_padded_strides[i] = original_rhs_padded_strides[i]; } }