From df9d61549e12d1810cc98d68c02ec44f415f0f35 Mon Sep 17 00:00:00 2001 From: Marcos Luciano Date: Sun, 19 Jun 2022 12:37:06 -0300 Subject: [PATCH] GPU Batched NMS --- nvdsinfer_custom_impl_Yolo/sortDetections.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvdsinfer_custom_impl_Yolo/sortDetections.cu b/nvdsinfer_custom_impl_Yolo/sortDetections.cu index 5a7b219..9c65a5b 100644 --- a/nvdsinfer_custom_impl_Yolo/sortDetections.cu +++ b/nvdsinfer_custom_impl_Yolo/sortDetections.cu @@ -75,7 +75,7 @@ cudaError_t sortDetections( int threads_per_block = 0; int number_of_blocks = 4; - if (_topK % 2 == 0) + if (_topK % 2 == 0 || _topK >= number_of_blocks) threads_per_block = _topK / number_of_blocks; else threads_per_block = (_topK / number_of_blocks) + 1;