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 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 (
Pointer[Scalar[dtype], MutUntrackedOrigin, address_space=AddressSpace.SHARED]):
Implemented traits
AnyType,
Copyable,
Deinitable,
ImplicitlyCopyable,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime members
num_elements
comptime num_elements = (layout.size() * num_tiles)
Storage
comptime Storage = Array[Scalar[dtype], Int((mul layout.size(), num_tiles))]
storage_size
comptime storage_size = (Int((mul layout.size(), num_tiles)) * size_of[dtype]())
Tile
comptime Tile = LayoutTensor[dtype, layout, MutAnyOrigin, address_space=AddressSpace.SHARED, alignment=alignment]
Methods
__init__
def __init__(ref[AddressSpace._value] storage: Array[Scalar[dtype], Int((mul layout.size(), num_tiles))]) -> Self
Initialize with Storage.
Args:
- storage (
Array[Scalar[dtype], Int((mul layout.size(), num_tiles))]): Storage.
def __init__(unsafe_ptr: Pointer[Scalar[dtype], address_space=AddressSpace.SHARED]) -> Self
Initialize with shared memory pointer.
Args:
- unsafe_ptr (
Pointer[Scalar[dtype], address_space=AddressSpace.SHARED]): Shared memory pointer.
__getitem__
def __getitem__[T: Intable](self, index: T) -> Self.Tile
Get tile at index.
Args:
- index (
T): Tile index.
Returns:
Self.Tile: Tile at index.
slice
def slice[length: Int](self, start: Int) -> SMemTileArray[dtype, layout, length, alignment]
Returns:
SMemTileArray[dtype, layout, length, alignment]
stack_allocation
static def stack_allocation() -> Self