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

copy_pinned_to_destinations

copy_pinned_to_destinations()​

max.driver.copy_pinned_to_destinations(source, destinations)

source

Copies a host buffer into destination buffers safely.

Copies source into each buffer in destinations. When source is pinned and the destinations span multiple devices, its deferred free is enqueued only on its owning device’s stream, so the memory manager could recycle the pinned staging while copies on the other devices’ streams are still reading it. Making the owning device’s stream wait for the other destination devices’ streams closes that window. The cross-stream wait is a no-op for a non-pinned source or a single device.

Parameters:

  • source (Buffer) – The host buffer to copy from (pinned for async H2D copies).
  • destinations (Sequence[Buffer]) – The per-device buffers to copy source into.

Return type:

None