Skip to main content

Mojo struct

ProducerTiles

@register_passable(trivial) struct ProducerTiles[a_type: DType, b_type: DType, a_tile_layout: Layout, b_tile_layout: Layout, num_pipeline_stages: Int, num_consumers: Int, cluster_size: Int, tma_transfer: Bool, //, origin: MutOrigin, ring_buffer_type: AnyStruct[RingBuffer[a_type, b_type, a_tile_layout, b_tile_layout, num_pipeline_stages, num_consumers, cluster_size, tma_transfer]]]

Context manager for producer access to ring buffer tiles.

This struct provides safe access to a single tile slot in the ring buffer for the producer to fill. It automatically handles barrier synchronization when entering and exiting the context.

Fields

  • ring_buffer_ptr (Pointer[ring_buffer_type, origin]):
  • barrier (UnsafePointer[SharedMemBarrier, address_space=AddressSpace.SHARED]):
  • a_tile (LayoutTensor[a_type, a_tile_layout, MutableAnyOrigin, address_space=AddressSpace.SHARED, alignment=NVIDIASharedMemoryBasePtr.alignment]):
  • b_tile (LayoutTensor[b_type, b_tile_layout, MutableAnyOrigin, address_space=AddressSpace.SHARED, alignment=NVIDIASharedMemoryBasePtr.alignment]):

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

ATile

alias ATile = ring_buffer_type.ATile

BTile

alias BTile = ring_buffer_type.BTile

RingBufferPtrType

alias RingBufferPtrType = Pointer[ring_buffer_type, origin]

Methods

__init__

__init__(ring_buffer_ptr: Pointer[ring_buffer_type, origin]) -> Self

__enter__

__enter__(mut self) -> Self

__exit__

__exit__(mut self)

Was this page helpful?