IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo trait

TileIO

Extends TensorEngine with whole-tile loads and stores.

A conforming engine names a register value type that holds a whole tile, TileValueType, and moves storage into and out of it. The layout travels with the storage handle, as in TensorOps, so an engine whose storage bakes in its extents can check them against the layout. TileTensor exposes these as the zero-coordinate load() and store(value) overloads.

Implemented traits​

AnyType, TensorEngine

comptime members​

TileValueType​

comptime TileValueType[dtype: DType]

The register value holding a whole tile of dtype elements.

Parameters​

  • ​dtype (DType): The element data type of the tile.

Required methods​

load_tile​

static def load_tile[mut: Bool, dtype: DType, origin: Origin[mut=mut], address_space: AddressSpace, LayoutType: TensorLayout, //](storage: Tuple[Self.StorageType[dtype, origin, address_space], LayoutType]) -> Self.TileValueType[dtype]

Loads the whole tile into a register value.

Parameters:

  • ​mut (Bool): The mutability of the storage, inferred from origin.
  • ​dtype (DType): The element data type of the storage.
  • ​origin (Origin[mut=mut]): The origin tracking the lifetime of the storage.
  • ​address_space (AddressSpace): The address space the storage resides in.
  • ​LayoutType (TensorLayout): The layout type of the tile.

Args:

Returns:

_Self.TileValueType[dtype]: The tile's contents as a TileValueType[dtype].

store_tile​

static def store_tile[dtype: DType, origin: MutOrigin, address_space: AddressSpace, LayoutType: TensorLayout, //](storage: Tuple[Self.StorageType[dtype, origin, address_space], LayoutType], value: Self.TileValueType[dtype])

Stores a register value over the whole tile.

Parameters:

  • ​dtype (DType): The element data type of the storage.
  • ​origin (MutOrigin): The origin tracking the lifetime of the storage.
  • ​address_space (AddressSpace): The address space the storage resides in.
  • ​LayoutType (TensorLayout): The layout type of the tile.

Args:

Was this page helpful?