Skip to main content

Mojo struct

TMABarrierHandler

@register_passable(trivial) struct TMABarrierHandler[expected_bytes: Int]

TMA barrier handler: sets expected bytes on prepare, noop on complete.

Initializes the pipeline on construction (phase=0, barrier counts).

Parameters

  • expected_bytes (Int): Total bytes expected per stage across all loaders.

Implemented traits

AnyType, BarrierHandler, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, RegisterPassable, TrivialRegisterPassable

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

__init__

__init__[num_stages: Int](mut pipeline: ProducerConsumerPipeline[num_stages], num_consumers: Int, cluster_size: Int) -> Self

prepare_stage

prepare_stage(self, mem_barrier: LegacyUnsafePointer[SharedMemBarrier, address_space=AddressSpace.SHARED])

complete_stage

complete_stage(self, mem_barrier: LegacyUnsafePointer[SharedMemBarrier, address_space=AddressSpace.SHARED])

Was this page helpful?