Skip to main content

Mojo struct

ProducerTile

@register_passable(trivial) struct ProducerTile[dtype: DType, layout: Layout, pipeline_stages: Int, B_rows: Int, B_cols: Int, W_rows: Int, W_cols: Int, consumer_warps: Int, reads_per_warp_block: Int, //, origin: MutOrigin, ring_buffer_type: AnyStruct[RingBuffer[consumer_warps, reads_per_warp_block]], warps_processed_per_producer: Int, producer_warps: Int]

Context manager for producer access to a single ring buffer tile.

Fields

  • producer_view_ptr (Pointer[RingBufferProducer[origin, ring_buffer_type, warps_processed_per_producer, producer_warps], origin]):
  • tile (LayoutTensor[dtype, LayoutTensor._compute_tile_layout[True, dtype, LayoutTensor._compute_tile_layout[True, dtype, pipeline_layout[layout, pipeline_stages](), MutAnyOrigin, AddressSpace.SHARED, Layout(IntTuple(1), IntTuple(1)), _get_layout_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), _get_index_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), False, 128, B_rows, B_cols]()[0], MutAnyOrigin, AddressSpace.SHARED, Layout(IntTuple(1), IntTuple(1)), _get_layout_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), _get_index_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), _tile_is_masked[pipeline_layout[layout, pipeline_stages](), B_rows, B_cols](), 128, W_rows, W_cols]()[0], MutAnyOrigin, address_space=AddressSpace.SHARED, layout_int_type=_get_layout_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), linear_idx_type=_get_index_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), masked=_tile_is_masked[pipeline_layout[layout, pipeline_stages](), B_rows, B_cols]() if _tile_is_masked[pipeline_layout[layout, pipeline_stages](), B_rows, B_cols]() else _tile_is_masked[LayoutTensor._compute_tile_layout[True, dtype, pipeline_layout[layout, pipeline_stages](), MutAnyOrigin, AddressSpace.SHARED, Layout(IntTuple(1), IntTuple(1)), _get_layout_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), _get_index_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), False, 128, B_rows, B_cols]()[0], W_rows, W_cols](), alignment=128]):
  • stage (Int):
  • warp_tile_idx (Int):

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, Movable, UnknownDestructibility

Aliases

__copyinit__is_trivial

alias __copyinit__is_trivial = True

__del__is_trivial

alias __del__is_trivial = True

__moveinit__is_trivial

alias __moveinit__is_trivial = True

ProducerViewPtrType

alias ProducerViewPtrType = Pointer[RingBufferProducer[origin, ring_buffer_type, warps_processed_per_producer, producer_warps], origin]

ProducerViewType

alias ProducerViewType = RingBufferProducer[origin, ring_buffer_type, warps_processed_per_producer, producer_warps]

Methods

__init__

__init__(producer_view_ptr: Pointer[RingBufferProducer[origin, ring_buffer_type, warps_processed_per_producer, producer_warps], origin], stage: Int, warp_tile_idx: Int) -> Self

__enter__

__enter__(mut self) -> LayoutTensor[dtype, LayoutTensor._compute_tile_layout[True, dtype, LayoutTensor._compute_tile_layout[True, dtype, pipeline_layout[layout, pipeline_stages](), MutAnyOrigin, AddressSpace.SHARED, Layout(IntTuple(1), IntTuple(1)), _get_layout_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), _get_index_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), False, 128, B_rows, B_cols]()[0], MutAnyOrigin, AddressSpace.SHARED, Layout(IntTuple(1), IntTuple(1)), _get_layout_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), _get_index_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), _tile_is_masked[pipeline_layout[layout, pipeline_stages](), B_rows, B_cols](), 128, W_rows, W_cols]()[0], MutAnyOrigin, address_space=AddressSpace.SHARED, layout_int_type=_get_layout_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), linear_idx_type=_get_index_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), masked=_tile_is_masked[pipeline_layout[layout, pipeline_stages](), B_rows, B_cols]() if _tile_is_masked[pipeline_layout[layout, pipeline_stages](), B_rows, B_cols]() else _tile_is_masked[LayoutTensor._compute_tile_layout[True, dtype, pipeline_layout[layout, pipeline_stages](), MutAnyOrigin, AddressSpace.SHARED, Layout(IntTuple(1), IntTuple(1)), _get_layout_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), _get_index_type(pipeline_layout[layout, pipeline_stages](), AddressSpace.SHARED), False, 128, B_rows, B_cols]()[0], W_rows, W_cols](), alignment=128]

Return the acquired tile for use.

Returns:

LayoutTensor

__exit__

__exit__(mut self)

Release the tile back to consumers.

Was this page helpful?