For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
TmemDeallocBarrier
struct TmemDeallocBarrier[cta_group: Int]
TMEM deallocation synchronization barrier.
Handles cluster-aware synchronization patterns for TMEM deallocation, supporting both single-CTA and multi-CTA (cta_group=2) configurations.
Parametersβ
- βcta_group (
Int): Number of cooperating CTAs (1 or 2).
Fieldsβ
- βbarrier (
TmemDeallocBarrier[cta_group].BarrierStorage):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime membersβ
BarrierStorageβ
comptime BarrierStorage = SMemArray[SharedMemBarrier, Int(1)]
Methodsβ
__init__β
def __init__(barrier: SMemArray[SharedMemBarrier, Int(1)]) -> Self
Initialize with shared memory barrier array.
Args:
- βbarrier (
SMemArray[SharedMemBarrier, Int(1)]): Shared memory barrier storage used to coordinate deallocation across warps and CTAs.
signal_peerβ
def signal_peer(self)
Signal peer CTA in cluster (cta_group=2 only).
signal_selfβ
def signal_self(self)
Signal own arrival at barrier.
waitβ
def wait[ticks: Optional[UInt32] = None](self)
Wait for barrier completion.
Parameters:
- βticks (
Optional[UInt32]): Optional hardware-suspend ceiling (ns) forwarded toSharedMemBarrier.wait.None(default) preserves the immediate-return spin for every existing caller.
complete_deallocβ
def complete_dealloc[max_cols: Int = Int(512)](self, tmem: TmemAllocation[cta_group, max_cols])
Complete TMEM deallocation sequence (MMA warp side).
Releases the allocation lock, waits for epilogue completion, then deallocates the TMEM.
Parameters:
- βmax_cols (
Int): TMEM columns to deallocate (defaults to 512 for SM100).
Args:
- βtmem (
TmemAllocation[cta_group, max_cols]):TmemAllocationto release and deallocate.
signal_completeβ
def signal_complete(self)
Signal TMEM consumption complete (Epilogue warp side).
For cta_group=2, signals peer CTA first, then signals self.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!