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 struct

WarpGroupBarrier

struct WarpGroupBarrier[num_threads: Int, barrier_id: Int = Int(0)]

Named barrier for warp group synchronization.

Wraps named_barrier and named_barrier_arrive with compile-time thread count and barrier ID for type-safe synchronization.

Parameters

  • num_threads (Int): Number of threads participating in the barrier.
  • barrier_id (Int): Hardware named-barrier ID to use (defaults to 0).

Implemented traits

AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable, RegisterPassable, TrivialRegisterPassable

Methods

arrive

static def arrive()

Signal arrival without blocking (non-blocking arrive).

wait

static def wait()

Block until all threads have arrived.

sync

static def sync()

Full barrier: arrive and wait for all threads.