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

TileWriterThreadwise

struct TileWriterThreadwise[dtype: DType, dst_layout: TensorLayout, dst_origin: MutOrigin, 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, linear_idx_type=dst_linear_idx_type, element_size=dst_element_size]

Methods​

__init__​

def __init__(dst: TileTensor[dtype, dst_layout, dst_origin, linear_idx_type=dst_linear_idx_type, element_size=dst_element_size], thread_idx: Int) -> Self

Initialize the threadwise tile writer.

Args:

write_tile​

def write_tile(self, src: TileTensor[dtype, 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: