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 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,
DevicePassable,
ImplicitlyCopyable,
ImplicitlyDeletable,
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β
__init__β
def __init__(out self, *, copy: Self)
Create a new instance of the value by copying an existing one.
Args:
- βcopy (
_Self): The value to copy.
Returns:
_Self
def __init__(out self, *, deinit move: Self)
Create a new instance of the value by moving the value of another.
Args:
- βmove (
_Self): The value to move.
Returns:
_Self
__call__β
def __call__[dtype: DType, LayoutType: TensorLayout](mut self, tile_coord: Coord, tile: TileTensor[dtype, LayoutType, MutAnyOrigin, Storage=tile.Storage, address_space=Self.src_address_space, linear_idx_type=tile.linear_idx_type], thread_layout: Layout) -> TileTensor[dtype, LayoutType, MutAnyOrigin, Storage=tile.Storage, 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.
Returns:
Provided methodsβ
get_type_nameβ
copyβ
def copy(self) -> Self
Explicitly construct a copy of self, a convenience method for Self(copy=self) when the type is inconvenient to write out.
Overriding this method is not allowed.
Returns:
_Self: A copy of this value.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!