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 module

cp_async

Defines the transfer atom for NVIDIA's cp.async global-to-shared copy.

CpAsync wraps cp.async: each thread copies 4, 8 or 16 bytes from global to shared memory, and completes in batches: issues join the open cp.async group, cp.async.commit_group closes it, and cp.async.wait_group waits until at most a given number of groups are outstanding.

The bulk copy, cp.async.bulk, is B200-specific and lives in layout.atoms.b200.cp_async.

You can import these APIs from the layout.atoms.cp_async module:

from layout.atoms.cp_async import CpAsync, CpAsyncGroups

Structsโ€‹

  • โ€‹CpAsync: cp.async: this thread copies bytes contiguous bytes from global to shared memory.
  • โ€‹CpAsyncGroups: cp.async groups: issues join the open group, commit closes it with cp.async.commit_group, and wait is cp.async.wait_group.

Was this page helpful?