Mojo struct
SharedMemoryManager
struct SharedMemoryManager[SMBP: SharedMemoryBasePtr]
Fieldsβ
- βbase_ptr (
UnsafePointer[Int8, MutAnyOrigin, address_space=AddressSpace.SHARED]): - βoffset (
Int):
Implemented traitsβ
AnyType,
ImplicitlyDestructible
comptime membersβ
Arrayβ
comptime Array[type: TrivialRegisterPassable, size: Int] = SMemArray[type, size]
Parametersβ
- βtype (
TrivialRegisterPassable): - βsize (
Int):
Tileβ
comptime Tile[dtype: DType, layout: Layout] = LayoutTensor[dtype, layout, MutAnyOrigin, address_space=AddressSpace.SHARED, alignment=SMBP.alignment]
Parametersβ
TileArrayβ
comptime TileArray[dtype: DType, layout: Layout, num_tiles: Int] = SMemTileArray[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.SHARED, alignment=SMBP.alignment]]](mut self) -> T
Allocate a single tile.
Returns:
T: Allocated tile.
build[dtype: DType, layout: Layout, num_tiles: Int, //, T: AnyStruct[SMemTileArray[dtype, layout, num_tiles, SMBP.alignment]]](mut self) -> T
Allocate a tile array.
Returns:
T: Allocated tile array.
build[type: TrivialRegisterPassable, size: Int, //, T: AnyStruct[SMemArray[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!