Skip to content

Commit 42fee5b

Browse files
Move barrier
1 parent c07b43e commit 42fee5b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

conch/kernels/vision/nms.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,11 @@ def _nms_suppression_kernel(
206206
# Conditionally store suppression result for high-IoU boxes
207207
tl.store(keep_mask_ptr + target_box_offsets, False, mask=suppression_mask)
208208

209-
# Potential race condition: we need to ensure all threads complete the store before the next
210-
# iteration otherwise we may load stale data for whether or not a box has been suppressed.
211-
tl.debug_barrier()
209+
# Potential race condition: we need to ensure all threads complete the store before the next
210+
# iteration otherwise we may load stale data for whether or not a box has been suppressed.
211+
# Aside: `debug_barrier` is a poor name for this function, because it is not only used for debugging,
212+
# but also to ensure synchronization between threads.
213+
tl.debug_barrier()
212214

213215

214216
def nms_launcher(

0 commit comments

Comments
 (0)