vpi.CudaBuffer

class vpi.CudaBuffer

The CUDA buffer class for interoperabilities.

The data of an image can be accessed in CUDA by other libraries via the methods: lock_cuda; rlock_cuda; wlock_cuda; and rwlock_cuda.

The data of other libraries can be accessed in the VPI library via the function: vpi.asimage().

Hint

Remember this class and its interface are used automatically behind the scenes to provide interoperability with other libraries, for only CUDA buffer data contents of the image class.

property __cuda_array_interface__

CUDA buffer array interface.

This property of the vpi.CudaBuffer class enables any library that supports the cuda array interface to access the data of an image via its container methods: lock_cuda; rlock_cuda; wlock_cuda; and rwlock_cuda. Examples of such libraries are:

  1. Numba;

  2. CuPy;

  3. PyArrow

  4. mpi4py;

  5. ArrayViews;

  6. JAX;

  7. PyCUDA;

  8. NVIDIA DALI;

Attributes

dtype

Data type of the CUDA buffer.

shape

Shape of the CUDA buffer.