For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo trait
TileOperation
Non-terminal counterpart to TileConsumer: mutates a tile in place between MMA and store. Composes additively with capability subtraits like AuxLoading for ops that need pre-loaded data.
Surface matches TileConsumer.__call__ modulo mut=True on the
tile (the op writes back) and on self. The two traits are role-
distinct (terminal vs non-terminal); a struct that wants to be
both would need separate disambiguation, which we'll deal with
if/when that comes up.
Implemented traits
AnyType,
Copyable,
Deinitable,
DevicePassable,
ImplicitlyCopyable,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime members
device_type
comptime device_type = _Self
src_address_space
comptime src_address_space
AddressSpace of the tile being transformed (typically LOCAL).
Required methods
__call__
def __call__[dtype: DType, LayoutType: TensorLayout](mut self, tile_coord: Coord[*tile_coord.element_types], tile: TileTensor[dtype, LayoutType, MutAnyOrigin, Engine=tile.Engine, address_space=Self.src_address_space, linear_idx_type=tile.linear_idx_type], thread_layout: Layout) -> TileTensor[dtype, LayoutType, MutAnyOrigin, Engine=tile.Engine, address_space=Self.src_address_space, linear_idx_type=tile.linear_idx_type]
Transform tile and return it.
Returns a TileTensor of the same shape as its tile argument.
Parameters:
- dtype (
DType): Element type of the tile. - LayoutType (
TensorLayout): Layout of the tile.
Args:
- tile_coord (
Coord[*tile_coord.element_types]): Absolute element coord of this sub-tile's top-left in the global output tensor — consistent withTileConsumer.__call__andElementwiseComputeFn. - tile (
TileTensor[dtype, LayoutType, MutAnyOrigin, Engine=tile.Engine, address_space=Self.src_address_space, linear_idx_type=tile.linear_idx_type]): Per-warp tile (kernel side passes aTileTensorview over the per-thread register storage;tile.static_shapeis the warp tile shape). - thread_layout (
Layout): Logical layout of the threads collaborating on this call. Passed as a value (its static dims are comptime-readable viatype_of(thread_layout)), so the kernel states "this call runs over these threads" the way thetileargument states "this tile is M x N". Impls that load aux inputs use it (e.g. to build a load copier) and shouldcomptime assertit is static.
Returns: