Skip to content

Commit 9fefbed

Browse files
Fix a potential bug in detection number reset between each inference (wang-xinyu#733)
Co-authored-by: Ksander <[email protected]>
1 parent f7d224f commit 9fefbed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

yolov5/yololayer.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ namespace nvinfer1
237237
{
238238
int outputElem = 1 + mMaxOutObject * sizeof(Detection) / sizeof(float);
239239
for (int idx = 0; idx < batchSize; ++idx) {
240-
CUDA_CHECK(cudaMemset(output + idx * outputElem, 0, sizeof(float)));
240+
CUDA_CHECK(cudaMemsetAsync(output + idx * outputElem, 0, sizeof(float), stream));
241241
}
242242
int numElem = 0;
243243
for (unsigned int i = 0; i < mYoloKernel.size(); ++i) {

0 commit comments

Comments
 (0)