Fix a security warning in cuda gemm int8 kernel (#14335)

### Description
fix a security warning in GemmInt8 cuda kernel

### Motivation and Context
it is for issue:
https://dev.azure.com/aiinfra/ONNX%20Runtime/_workitems/edit/11158/

Co-authored-by: Cheng Tang <chenta@microsoft.com@orttrainingdev9.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
This commit is contained in:
Tang, Cheng 2023-01-18 09:00:44 -08:00 committed by GitHub
parent 8236808e89
commit 734ae398ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,8 +20,9 @@ Status GemmInt8(int m, int n, int k,
const CudaKernel* cuda_kernel, onnxruntime::Stream* ort_stream) {
ORT_ENFORCE(a != nullptr && b != nullptr && c != nullptr, "input matrix should not be null");
ORT_ENFORCE(cuda_kernel != nullptr, "kernel is null");
ORT_ENFORCE(ort_stream != nullptr, "Cuda kernel must have the stream instance");
cudaStream_t stream = ort_stream ? static_cast<cudaStream_t>(ort_stream->GetHandle()) : nullptr;
cudaStream_t stream = static_cast<cudaStream_t>(ort_stream->GetHandle());
// pad A and B to make their leading dimension be multiples of 32
// because cublasGemmEx requires: