Mojo struct
SMemTileArrayType
@register_passable(trivial)
struct SMemTileArrayType[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 (
LegacyUnsafePointer[Scalar[dtype], address_space=AddressSpace.SHARED]):
Implemented traits
AnyType,
Copyable,
ImplicitlyCopyable,
Movable,
UnknownDestructibility
Aliases
__copyinit__is_trivial
alias __copyinit__is_trivial = True
__del__is_trivial
alias __del__is_trivial = True
__moveinit__is_trivial
alias __moveinit__is_trivial = True
storage_size
alias storage_size = ((layout.size() * size_of[dtype]()) * num_tiles)
Tile
alias Tile = LayoutTensor[dtype, layout, MutAnyOrigin, address_space=AddressSpace.SHARED, alignment=alignment]
Methods
__init__
__init__[mut: Bool, //, origin: Origin[mut]](unsafe_ptr: LegacyUnsafePointer[Scalar[dtype], address_space=AddressSpace.SHARED, mut=mut, origin=origin]) -> Self
Initialize with shared memory pointer.
Args:
- unsafe_ptr (
LegacyUnsafePointer): Shared memory pointer.
__getitem__
__getitem__[T: Intable](self, index: T) -> LayoutTensor[dtype, layout, MutAnyOrigin, address_space=AddressSpace.SHARED, alignment=alignment]
Get tile at index.
Args:
- index (
T): Tile index.
Returns:
LayoutTensor: Tile at index.
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!