IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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​

  • ​dt (DType): The element type.
  • ​bytes (Int): The bytes one issue copies: 4, 8 or 16.

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:

Args:

Was this page helpful?