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

named_barrier_arrive

named_barrier_arrive[num_threads: Int32](id: Int32 = Int32(0))

Arrives at a named synchronization barrier at the block level.

This function marks the arrival of a named synchronization barrier point using a specific barrier ID.

Notes:

  • Only supported on NVIDIA GPUs.
  • Maps directly to the nvvm.barrier.arrive instruction.
  • Useful for fine-grained synchronization when different subsets of threads need to synchronize independently.
  • The barrier ID must not exceed 16.
  • All threads participating in the barrier must specify the same num_threads value.

Parameters:

  • num_threads (Int32): The number of threads that must reach the barrier before any can proceed.

Args:

  • id (Int32): The barrier identifier (0-16). Default is 0.