warp.from_ipc_handle#

warp.from_ipc_handle(handle, dtype, shape, strides=None, device=None)[source]#

Create an array from an IPC handle.

The dtype, shape, and optional strides arguments should match the values from the array from which handle was created.

Parameters:
  • handle (bytes) – The interprocess memory handle for an existing device memory allocation.

  • dtype – One of the available data types, such as warp.float32, warp.mat33, or a custom struct.

  • shape (tuple[int, ...]) – Dimensions of the array.

  • strides (tuple[int, ...] | None) – Number of bytes in each dimension between successive elements of the array.

  • device (Device | str | None) – Device to associate with the array.

Returns:

An array created from the existing memory allocation described by the interprocess memory handle handle.

A copy of the underlying data is not made. Modifications to the array’s data will be reflected in the original process from which handle was exported.

Raises:

RuntimeError – IPC is not supported on device.

Return type:

array