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).

Python function

batch_inplace_copy

batch_inplace_copy()

max.driver.batch_inplace_copy(dsts, srcs)

source

Copies srcs[i] into dsts[i] in as few driver submissions as possible.

Sources may be host, pinned, same-device or peer memory in any mix. Identity pairs (dst is src) are skipped.

One submission is one stream, and a stream only orders the writes it performs, so destinations are grouped by device and each device’s group is submitted on that device’s own stream. Callers do not need to group.

Parameters:

  • dsts (Sequence[Buffer]) – Destination buffers, in any mix of devices.
  • srcs (Sequence[Buffer]) – Source buffers, paired with dsts by index.

Raises:

ValueError – If dsts/srcs lengths differ.

Return type:

None