Skip to main content

Mojo struct

Consumer

@register_passable(trivial) struct Consumer[origin: MutOrigin, a_type: DType, b_type: DType, a_tile_layout: Layout, b_tile_layout: Layout, num_pipeline_stages: Int, num_group_stages: Int, k_group_size: Int]

Consumer view with get_tiles() API.

Fields

  • ring_buffer_ptr (Pointer[Consumer[origin, a_type, b_type, a_tile_layout, b_tile_layout, num_pipeline_stages, num_group_stages, k_group_size].RingBufferType, origin]):

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, Movable, UnknownDestructibility

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

RingBufferType

comptime RingBufferType = RingBuffer[a_type, b_type, a_tile_layout, b_tile_layout, num_pipeline_stages, num_group_stages, k_group_size]

Methods

__enter__

__enter__(mut self) -> Self

__exit__

__exit__(mut self)

get_tiles

get_tiles(mut self) -> ConsumerTiles[origin, a_type, b_type, a_tile_layout, b_tile_layout, num_pipeline_stages, num_group_stages, k_group_size]

Get the next slot with stage, barrier, and tile arrays.

Synchronization is handled internally - waits for tiles to be ready.

Returns:

ConsumerTiles

Was this page helpful?