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
CpAsyncBulk
struct CpAsyncBulk[dt: DType, bytes: Int, barrier_origin: MutOrigin]
cp.async.bulk.shared::cta.global.mbarrier::complete_tx::bytes: one thread copies bytes contiguous bytes from global to shared memory, completing on barrier.
Parameters
- dt (
DType): The element type. - bytes (
Int): The bytes one issue copies, a multiple of 16 and a power of two. - barrier_origin (
MutOrigin): The origin of the barrier.
Fields
- barrier (
Pointer[SharedMemBarrier, barrier_origin, address_space=AddressSpace.SHARED]): The mbarrier the copy's bytes arrive on.
Implemented traits
AnyType,
Atom,
Copyable,
Deinitable,
ImplicitlyCopyable,
Movable,
RegisterPassable,
TransferAtom,
TrivialRegisterPassable
comptime members
Completion
comptime Completion = MBarrierTransactions
The copy's bytes arrive on the atom's mbarrier.
dst_map
comptime dst_map = vector_map((bytes // size_of[dt]()), size_of[dt]())
Where each index writes the destination.
DstEngine
comptime DstEngine = DefaultEngine
The engine of the memory the instruction writes.
dtype
comptime dtype = dt
The element type the instruction moves.
shape
comptime shape = ParameterList()
The instruction's shape, such as (32, 16) for tcgen05.ld.32x32b.x16 or (m, n, k) for an MMA.
shape_values
comptime shape_values = (bytes // size_of[dt]())
One issue moves a run of bytes bytes of elements.
src_map
comptime src_map = vector_map((bytes // size_of[dt]()), size_of[dt]())
Where each index reads the source.
SrcEngine
comptime SrcEngine = DefaultEngine
The engine of the memory the instruction reads.
Methods
__call__
def __call__[T: DType, LD: TensorLayout, ED: TensorEngine, LS: TensorLayout, ES: TensorEngine](self, dst: MutTileTensor[T, LD, Engine=ED, address_space=dst.address_space, linear_idx_type=dst.linear_idx_type], src: ImmTileTensor[T, LS, Engine=ES, address_space=src.address_space, linear_idx_type=src.linear_idx_type])
Issues the copy; its bytes arrive on barrier.
Parameters:
- T (
DType): The operands' element type. - LD (
TensorLayout): The shared view's layout. - ED (
TensorEngine): The shared view's engine. - LS (
TensorLayout): The global view's layout. - ES (
TensorEngine): The global view's engine.
Args:
- dst (
MutTileTensor[T, LD, Engine=ED, address_space=dst.address_space, linear_idx_type=dst.linear_idx_type]): Shared memory, from the copy's first element. - src (
ImmTileTensor[T, LS, Engine=ES, address_space=src.address_space, linear_idx_type=src.linear_idx_type]): Global memory, from the copy's first element.