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
CpAsync
struct CpAsync[dt: DType, bytes: Int]
cp.async: this thread copies bytes contiguous bytes from global to shared memory.
Parameters
Implemented traits
AnyType,
Atom,
Copyable,
Deinitable,
ImplicitlyCopyable,
Movable,
RegisterPassable,
TransferAtom,
TrivialRegisterPassable
comptime members
Completion
comptime Completion = CpAsyncGroups
Issues join the open cp.async group.
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 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; it joins the open cp.async group.
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.