Fix a potential bug in detection number reset between each inference (#733)

Co-authored-by: Ksander <ksander.ejjaaouani@digeiz.com>
This commit is contained in:
Armassarion 2021-09-22 13:22:28 +02:00 committed by GitHub
parent f7d224f9e4
commit 9fefbed77f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,7 +237,7 @@ namespace nvinfer1
{
int outputElem = 1 + mMaxOutObject * sizeof(Detection) / sizeof(float);
for (int idx = 0; idx < batchSize; ++idx) {
CUDA_CHECK(cudaMemset(output + idx * outputElem, 0, sizeof(float)));
CUDA_CHECK(cudaMemsetAsync(output + idx * outputElem, 0, sizeof(float), stream));
}
int numElem = 0;
for (unsigned int i = 0; i < mYoloKernel.size(); ++i) {