Skip to main content

Mojo struct

WarpGroupBarrier

@register_passable(trivial) struct WarpGroupBarrier[num_threads: Int, barrier_id: 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.

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable

comptime members

__copyinit__is_trivial

comptime __copyinit__is_trivial = True

__del__is_trivial

comptime __del__is_trivial = True

__moveinit__is_trivial

comptime __moveinit__is_trivial = True

Methods

arrive

static arrive()

Signal arrival without blocking (non-blocking arrive).

wait

static wait()

Block until all threads have arrived.

sync

static sync()

Full barrier: arrive and wait for all threads.

Was this page helpful?