mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-27 20:02:15 +00:00
Fix some prefast warnings (#12936)
This commit is contained in:
parent
64466c2d62
commit
9edc9465f0
3 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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<size_t>(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<size_t>(i) - offset] != 1) {
|
||||
rhs_padded_strides[i] = original_rhs_padded_strides[i];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue