GPU Batched NMS

This commit is contained in:
Marcos Luciano
2022-06-19 12:37:06 -03:00
parent f80aa10cf2
commit df9d61549e

View File

@@ -75,7 +75,7 @@ cudaError_t sortDetections(
int threads_per_block = 0; int threads_per_block = 0;
int number_of_blocks = 4; int number_of_blocks = 4;
if (_topK % 2 == 0) if (_topK % 2 == 0 || _topK >= number_of_blocks)
threads_per_block = _topK / number_of_blocks; threads_per_block = _topK / number_of_blocks;
else else
threads_per_block = (_topK / number_of_blocks) + 1; threads_per_block = (_topK / number_of_blocks) + 1;