Mojo struct
SharedMemoryManager
struct SharedMemoryManager[SMBP: SharedMemoryBasePtr]
Fields
- base_ptr (
LegacyUnsafePointer[Int8, address_space=AddressSpace.SHARED]): - offset (
Int):
Implemented traits
AnyType,
UnknownDestructibility
Aliases
__del__is_trivial
alias __del__is_trivial = True
Array
alias Array[type: AnyTrivialRegType, size: Int] = SMemArrayType[type, size]
Parameters
- type (
AnyTrivialRegType): - size (
Int):
Tile
alias Tile[dtype: DType, layout: Layout] = LayoutTensor[dtype, layout, MutAnyOrigin, address_space=AddressSpace.SHARED, alignment=SMBP.alignment]
Parameters
TileArray
alias TileArray[dtype: DType, layout: Layout, num_tiles: Int] = SMemTileArrayType[dtype, layout, num_tiles, SMBP.alignment]
Parameters
Methods
__init__
__init__(out self)
Initialize the shared memory manager.
build
build[dtype: DType, layout: Layout, //, T: AnyStruct[LayoutTensor[dtype, layout, MutAnyOrigin, address_space=AddressSpace(3), alignment=SMBP.alignment]]](mut self) -> T
Allocate a single tile.
Returns:
T: Allocated tile.
build[dtype: DType, layout: Layout, num_tiles: Int, //, T: AnyStruct[SMemTileArrayType[dtype, layout, num_tiles, SMBP.alignment]]](mut self) -> T
Allocate a tile array.
Returns:
T: Allocated tile array.
build[type: AnyTrivialRegType, size: Int, //, T: AnyStruct[SMemArrayType[type, size]]](mut self) -> T
Allocate a regular array.
Returns:
T: Allocated array.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!