Skip to main content

Mojo module

tile_tensor

TileTensor type for structured memory access with compile-time layout information.

comptime values

LTToTTLayout

comptime LTToTTLayout[lt_layout: Layout] = Layout[#kgen.variadic.reduce(#kgen.variadic.tabulate(len[IntTuple](lt_layout.shape), [idx: __mlir_type.index] _int_to_dim(lt_layout.shape[idx].value())), base=, reducer=[PrevV: Variadic[CoordLike], VA: Variadic[Dim], idx: __mlir_type.index] #kgen.variadic.concat(PrevV, ComptimeInt[VA[idx]._value_or_missing] if (VA[idx] != -31337) else RuntimeInt[DType.int64])), #kgen.variadic.reduce(#kgen.variadic.tabulate(len[IntTuple](lt_layout.stride), [idx: __mlir_type.index] _int_to_dim(lt_layout.stride[idx].value())), base=, reducer=[PrevV: Variadic[CoordLike], VA: Variadic[Dim], idx: __mlir_type.index] #kgen.variadic.concat(PrevV, ComptimeInt[VA[idx]._value_or_missing] if (VA[idx] != -31337) else RuntimeInt[DType.int64]))]

Derive a TileTensor Layout from a legacy Layout.

Known dimensions become ComptimeInt, UNKNOWN_VALUE dimensions become RuntimeInt. Works for flat layouts of rank 1 through 6.

Parameters

  • lt_layout (Layout): The legacy Layout to convert.

Structs

  • TileTensor: A tensor type with trait-based layouts supporting nested and hierarchical indexing.

Functions

Was this page helpful?