Mojo struct
SMemTileArrayType
@register_passable(trivial)
struct SMemTileArrayType[dtype: DType, layout: Layout, num_tiles: Int, alignment: Int]
Shared memory tile array for managing multiple tiles in shared memory.
Parameters
- dtype (
DType
): Data type of the tiles. - layout (
Layout
): Layout configuration for each tile. - num_tiles (
Int
): Number of tiles in the array. - alignment (
Int
): Memory alignment requirement.
Fields
- ptr (
UnsafePointer[Scalar[dtype], address_space=AddressSpace(3)]
):
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
TileType
alias TileType = LayoutTensor[dtype, layout, MutableAnyOrigin, address_space=AddressSpace(3), alignment=alignment]
Methods
__init__
__init__[mut: Bool, //, origin: Origin[mut]](unsafe_ptr: UnsafePointer[Scalar[dtype], address_space=AddressSpace(3), mut=mut, origin=origin]) -> Self
Initialize the shared memory tile array.
Args:
- unsafe_ptr (
UnsafePointer
): Pointer to the shared memory location.
__getitem__
__getitem__[T: Intable](self, index: T) -> LayoutTensor[dtype, layout, MutableAnyOrigin, address_space=AddressSpace(3), alignment=alignment]
Access a tile at the specified index.
Args:
- index (
T
): The index of the tile to access.
Returns:
LayoutTensor
: The tile at the specified index.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!