mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Fix prefast warning 11263 (#14508)
### Description <!-- Describe your changes. --> https://dev.azure.com/aiinfra/ONNX%20Runtime/_workitems/edit/11263/ ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
This commit is contained in:
parent
3cc81460e0
commit
bc8686d365
1 changed files with 2 additions and 1 deletions
|
|
@ -140,8 +140,9 @@ Status Sample(AllocatorPtr& allocator,
|
|||
// Multinomial sampling
|
||||
gsl::span<float>& d_sampled = sampling_state->d_sampled;
|
||||
gsl::span<float>& h_sampled_all = sampling_state->h_sampled_all;
|
||||
size_t sample_offset = (static_cast<size_t>(step) - 1) * static_cast<size_t>(parameters->batch_size);
|
||||
CUDA_RETURN_IF_ERROR(cudaMemcpyAsync(d_sampled.data(),
|
||||
h_sampled_all.data() + (step - 1) * parameters->batch_size,
|
||||
h_sampled_all.data() + sample_offset,
|
||||
sizeof(float) * parameters->batch_size,
|
||||
cudaMemcpyHostToDevice,
|
||||
cuda_stream));
|
||||
|
|
|
|||
Loading…
Reference in a new issue