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 struct
SMemTileArray
struct SMemTileArray[dtype: DType, layout: Layout, num_tiles: Int, alignment: Int]
Array of tiles in shared memory.
Parametersβ
- βdtype (
DType): Tile data type. - βlayout (
Layout): Tile layout configuration. - βnum_tiles (
Int): Number of tiles. - βalignment (
Int): Memory alignment.
Fieldsβ
- βptr (
UnsafePointer[Scalar[dtype], MutAnyOrigin, address_space=AddressSpace.SHARED]):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime membersβ
num_elementsβ
comptime num_elements = (layout.size() * num_tiles)
Storageβ
comptime Storage = InlineArray[Scalar[dtype], SMemTileArray[dtype, layout, num_tiles, alignment].num_elements]
storage_sizeβ
comptime storage_size = (SMemTileArray[dtype, layout, num_tiles, alignment].num_elements * size_of[dtype]())
Tileβ
comptime Tile = LayoutTensor[dtype, layout, MutAnyOrigin, address_space=AddressSpace.SHARED, alignment=alignment]
Methodsβ
__init__β
__init__(ref[AddressSpace._value] storage: InlineArray[Scalar[dtype], SMemTileArray[dtype, layout, num_tiles, alignment].num_elements]) -> Self
Initialize with Storage.
Args:
- βstorage (
InlineArray[Scalar[dtype], SMemTileArray[dtype, layout, num_tiles, alignment].num_elements]): Storage.
__init__(unsafe_ptr: UnsafePointer[Scalar[dtype], address_space=AddressSpace.SHARED]) -> Self
Initialize with shared memory pointer.
Args:
- βunsafe_ptr (
UnsafePointer[Scalar[dtype], address_space=AddressSpace.SHARED]): Shared memory pointer.
__getitem__β
__getitem__[T: Intable](self, index: T) -> SMemTileArray[dtype, layout, num_tiles, alignment].Tile
Get tile at index.
Args:
- βindex (
T): Tile index.
Returns:
SMemTileArray[dtype, layout, num_tiles, alignment].Tile: Tile at index.
sliceβ
slice[length: Int](self, start: Int) -> SMemTileArray[dtype, layout, length, alignment]
Returns:
SMemTileArray[dtype, layout, length, alignment]
stack_allocationβ
static stack_allocation() -> Self
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!