IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

non_max_suppression_gpu

def non_max_suppression_gpu[dtype: DType, BoxesLayout: TensorLayout, ScoresLayout: TensorLayout, OutputLayout: TensorLayout, BoxesEngine: TensorEngine = DefaultEngine, ScoresEngine: TensorEngine = DefaultEngine, OutputEngine: TensorEngine = DefaultEngine](boxes: ImmTileTensor[dtype, BoxesLayout, ImmutAnyOrigin, Engine=BoxesEngine], scores: ImmTileTensor[dtype, ScoresLayout, ImmutAnyOrigin, Engine=ScoresEngine], output: TileTensor[.int64, OutputLayout, MutAnyOrigin, Engine=OutputEngine], max_output_boxes_per_class: Int, iou_threshold: Float32, score_threshold: Float32, ctx: DeviceContext)

Runs NMS on the GPU: pairs in batch-major order, greedy state in one CTA.

The output's first dimension must be the host-sized selection count; rows pack sequentially in pair order, matching the CPU kernel.

Parameters:

  • ​dtype (DType): The data type for box coordinates and scores.
  • ​BoxesLayout (TensorLayout): Layout type of the boxes tensor.
  • ​ScoresLayout (TensorLayout): Layout type of the scores tensor.
  • ​OutputLayout (TensorLayout): Layout type of the output tensor.
  • ​BoxesEngine (TensorEngine): Engine type of the boxes tensor.
  • ​ScoresEngine (TensorEngine): Engine type of the scores tensor.
  • ​OutputEngine (TensorEngine): Engine type of the output tensor.

Args:

Raises:

Error: If num_boxes exceeds the shared-memory candidate budget; that shape runs on the host path instead.

Was this page helpful?