IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Mojo struct

ConsumerTiles

struct ConsumerTiles[origin: MutOrigin, Payload: TilePayload, num_group_stages: Int, k_group_size: Int]

Context manager for consuming one input pipeline stage.

Provides the same accessor interface as InputConsumerStage (payload, stage, mbar) but automatically releases the consumer on scope exit.

Usage: with consumer.acquire() as tiles: process_tiles(tiles.payload(), tiles.stage()) # release called automatically

Parameters​

  • ​origin (MutOrigin): Origin of the pipeline reference.
  • ​Payload (TilePayload): The tile payload type.
  • ​num_group_stages (Int): Number of synchronization stages.
  • ​k_group_size (Int): Number of tiles per synchronization stage.

Fields​

  • ​pipeline_ptr (Pointer[InputTilePipeline[Payload, num_group_stages, k_group_size], origin]):

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDeletable, Movable, RegisterPassable, TrivialRegisterPassable

comptime members​

PipelineType​

comptime PipelineType = InputTilePipeline[Payload, num_group_stages, k_group_size]

Methods​

__init__​

def __init__(pipeline_ptr: Pointer[InputTilePipeline[Payload, num_group_stages, k_group_size], origin], stage: UInt32, mbar: UnsafePointer[SharedMemBarrier, MutUntrackedOrigin, address_space=AddressSpace.SHARED]) -> Self

payload​

def payload(self) -> Payload

Get the tile payload for direct access.

Returns:

Payload

stage​

def stage(self) -> UInt32

Get the current stage index.

Returns:

UInt32

mbar​

def mbar(self) -> MbarPtr

Get the barrier pointer.

Returns:

MbarPtr

__enter__​

def __enter__(self) -> Self

__exit__​

def __exit__(self)

Release the consumer (signals and advances to next stage).