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 function
smem_subtile
smem_subtile[tile_rows: Int, tile_cols: Int, BN: Int, BK: Int, dtype: DType](smem_ptr: UnsafePointer[Scalar[dtype], MutAnyOrigin, address_space=AddressSpace.SHARED], tile_row: Int, tile_col: Int) -> TileTensor[dtype, Layout[*?, *?], MutAnyOrigin, address_space=AddressSpace.SHARED]
Creates a flat TileTensor sub-view of a blocked SMEM layout.
The blocked layout has num_repeats contiguous BN x BK blocks. This function computes the physical offset for a block-aligned tile and returns a row-major TileTensor view with strides (tile_cols, 1).
Correct only when tile_cols == BK (tiles don't cross block boundaries in the column dimension).
Parameters:
- βtile_rows (
Int): Height of the sub-tile. - βtile_cols (
Int): Width of the sub-tile (must equal BK for block alignment). - βBN (
Int): Number of rows per block (full block height). - βBK (
Int): Number of columns per block (full block width). - βdtype (
DType): Element data type.
Args:
- βsmem_ptr (
UnsafePointer[Scalar[dtype], MutAnyOrigin, address_space=AddressSpace.SHARED]): Base pointer to the SMEM allocation. - βtile_row (
Int): Tile row index (0-based, in units of tile_rows). - βtile_col (
Int): Tile column index (0-based, in units of tile_cols).
Returns:
TileTensor[dtype, Layout[*?, *?], MutAnyOrigin, address_space=AddressSpace.SHARED]: A TileTensor view into the specified sub-tile region.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!