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

Mojo function

split_smem

def split_smem[first_size: Int, second_size: Int, first_dtype: DType, second_dtype: DType](tensor: TileTensor[Storage=tensor.Storage, address_space=AddressSpace.SHARED, linear_idx_type=tensor.linear_idx_type, element_size=tensor.element_size]) -> Tuple[TileTensor[first_dtype, Layout[*?, *?], MutAnyOrigin, address_space=AddressSpace.SHARED], TileTensor[second_dtype, Layout[*?, *?], MutAnyOrigin, address_space=AddressSpace.SHARED]]

Split a shared memory tensor into two TileTensors at the boundary of first_size elements.

TMA only uses .ptr — flat row_major layout avoids needing InternalLayout equivalents of swizzled layouts.

Returns:

Tuple[TileTensor[first_dtype, Layout[*?, *?], MutAnyOrigin, address_space=AddressSpace.SHARED], TileTensor[second_dtype, Layout[*?, *?], MutAnyOrigin, address_space=AddressSpace.SHARED]]