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
TmemAllocation
struct TmemAllocation[cta_group: Int, max_cols: Int = Int(512)]
Handle to allocated Tensor Memory.
Lifecycle: allocate() β use β release_lock() β wait β deallocate()
Parametersβ
Fieldsβ
- βaddr (
UInt32):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime membersβ
SmemAddrStorageβ
comptime SmemAddrStorage = SMemArray[UInt32, Int(1)]
Methodsβ
__init__β
def __init__(addr: UInt32) -> Self
allocateβ
static def allocate(smem_addr: SMemArray[UInt32, Int(1)]) -> Self
Allocate TMEM (MMA warp). Address stored in smem for epilogue.
Args:
- βsmem_addr (
SMemArray[UInt32, Int(1)]): Shared memory slot that receives the allocated TMEM address for cross-warp sharing with the epilogue.
from_sharedβ
static def from_shared(smem_addr: SMemArray[UInt32, Int(1)]) -> Self
Get handle from existing allocation (epilogue warp).
Args:
- βsmem_addr (
SMemArray[UInt32, Int(1)]): Shared memory slot holding the TMEM address previously written byallocate.
release_lockβ
def release_lock(self)
Release allocation lock before waiting for epilogue.
deallocateβ
def deallocate(self)
Free TMEM after epilogue completion.