PyNvCodec.CudaBuffer

class PyNvCodec.CudaBuffer
__init__(*args, **kwargs)

Methods

Clone(self)

Deep copy = CUDA mem alloc + CUDA mem copy

CopyFrom(*args, **kwargs)

Overloaded function.

GetElemSize(self)

Get size of single element in bytes

GetNumElems(self)

Get number of elements in buffer

GetRawMemSize(self)

Get size of buffer in bytes

GpuMem(self)

Get CUdeviceptr of memory allocation

Make(elem_size, num_elems, gpu_id)

Constructor method

__init__(*args, **kwargs)

Clone(self: PyNvCodec._PyNvCodec.CudaBuffer) PyNvCodec._PyNvCodec.CudaBuffer

Deep copy = CUDA mem alloc + CUDA mem copy

CopyFrom(*args, **kwargs)

Overloaded function.

  1. CopyFrom(self: PyNvCodec._PyNvCodec.CudaBuffer, other: PyNvCodec._PyNvCodec.CudaBuffer, context: int, stream: int) -> None

    Copy content of another CudaBuffer into this CudaBuffer

    param other:

    other CudaBuffer

    param context:

    CUDA context to use

    param stream:

    CUDA stream to use

  2. CopyFrom(self: PyNvCodec._PyNvCodec.CudaBuffer, other: PyNvCodec._PyNvCodec.CudaBuffer, gpu_id: int) -> None

    Copy content of another CudaBuffer into this CudaBuffer

    param other:

    other CudaBuffer

    param gpu_id:

    GPU to use for memcopy

GetElemSize(self: PyNvCodec._PyNvCodec.CudaBuffer) int

Get size of single element in bytes

GetNumElems(self: PyNvCodec._PyNvCodec.CudaBuffer) int

Get number of elements in buffer

GetRawMemSize(self: PyNvCodec._PyNvCodec.CudaBuffer) int

Get size of buffer in bytes

GpuMem(self: PyNvCodec._PyNvCodec.CudaBuffer) int

Get CUdeviceptr of memory allocation

static Make(elem_size: int, num_elems: int, gpu_id: int) PyNvCodec._PyNvCodec.CudaBuffer

Constructor method

Parameters:
  • elem_size – single buffer element size in bytes

  • num_elems – number of elements in buffer

  • gpu_id – GPU to use for memcopy