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
TileWriterThreadwise
struct TileWriterThreadwise[dtype: DType, dst_layout: TensorLayout, dst_origin: MutOrigin, dst_storage: TensorStorage, dst_linear_idx_type: DType, dst_element_size: Int, //, thread_layout: Layout[thread_layout.shape_types, thread_layout.stride_types], simd_size: Int, half_tile: Bool = False, swapAB: Bool = False]
Fieldsβ
- βdst (
TileWriterThreadwise[thread_layout, simd_size, half_tile, swapAB].DstType): - βthread_idx (
Int):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable,
RegisterPassable,
SMemTileWriter,
TrivialRegisterPassable
comptime membersβ
DstTypeβ
comptime DstType = TileTensor[dtype, dst_layout, dst_origin, Storage=dst_storage, linear_idx_type=dst_linear_idx_type, element_size=dst_element_size]
Methodsβ
__init__β
def __init__(dst: TileTensor[dtype, dst_layout, dst_origin, Storage=dst_storage, linear_idx_type=dst_linear_idx_type, element_size=dst_element_size], thread_idx: Int) -> Self
Initialize the threadwise tile writer.
Args:
- βdst (
TileTensor[dtype, dst_layout, dst_origin, Storage=dst_storage, linear_idx_type=dst_linear_idx_type, element_size=dst_element_size]): Destination tensor in global memory. - βthread_idx (
Int): Thread index within the consumer warp group.
write_tileβ
def write_tile(self, src: TileTensor[dtype, Storage=src.Storage, address_space=AddressSpace.SHARED, linear_idx_type=src.linear_idx_type, element_size=src.element_size], coords: Tuple[Int, Int])
Write a tile using thread-distributed stores.
Each thread writes a portion of the tile with proper swizzling for optimal memory access patterns.
Args:
- βsrc (
TileTensor[dtype, Storage=src.Storage, address_space=AddressSpace.SHARED, linear_idx_type=src.linear_idx_type, element_size=src.element_size]): Source tile in shared memory. - βcoords (
Tuple[Int, Int]): Tile indices (row_tile, col_tile) in the destination matrix.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!