Skip to main content

Mojo struct

SharedMemoryManager

struct SharedMemoryManager[dtype: DType, BM: Int, BN: Int, BK: Int, depth: Int, num_rowwise_warps: Int, token_gen: Bool]

Fields

  • p_smem (UnsafePointer[SIMD[dtype, 1], address_space=AddressSpace(3)]):
  • k_v_smem (UnsafePointer[SIMD[dtype, 1], address_space=AddressSpace(3)]):

Implemented traits

AnyType, Defaultable, UnknownDestructibility

Methods

__init__

__init__(out self)

get_k_iter

get_k_iter(self) -> LayoutTensorIter[dtype, row_major(BN, BK) if token_gen else Layout(IntTuple(IntTuple(BN), IntTuple(8, 4), Tuple()), IntTuple(IntTuple(8), IntTuple(1, (BN * 8)), Tuple())), MutableAnyOrigin, address_space=AddressSpace(3), circular=True]

get_v_iter

get_v_iter(self) -> LayoutTensorIter[dtype, row_major(BK, BN), MutableAnyOrigin, address_space=AddressSpace(3), circular=True]

get_p_iter

get_p_iter(self) -> LayoutTensorIter[dtype, row_major(BM, BK), MutableAnyOrigin, address_space=AddressSpace(3), circular=True]

get_warp_scratch_tensor

get_warp_scratch_tensor(self) -> LayoutTensor[get_accum_type[::DType,::DType](), row_major((num_rowwise_warps * 2), BM), MutableAnyOrigin, address_space=AddressSpace(3)]

Was this page helpful?