Class GXFMemoryBuffer

Base Type

  • public nvidia::gxf::MemoryBuffer

class GXFMemoryBuffer : public nvidia::gxf::MemoryBuffer

Class to wrap the nvidia::gxf::MemoryBuffer object.

This class inherits nvidia::gxf::MemoryBuffer and is used with DLManagedTensorCtx class to wrap the GXF Tensor.

A shared pointer to this class in DLManagedTensorCtx class is used as the deleter of the DLManagedTensorCtx::memory_ref

When the last reference to the DLManagedTensorCtx object is released, DLManagedTensorCtx::memory_ref will also be destroyed, which will call the deleter function of the DLManagedTensor object.

This class holds shape and strides data of DLTensor object so that the data is released together with the DLManagedTensor object.

Public Functions

inline explicit GXFMemoryBuffer(nvidia::gxf::MemoryBuffer &&other)

Public Members

nvidia::gxf::Tensor::stride_array_t gxf_strides

Strides of the GXF Tensor.

std::vector<int64_t> dl_shape

Shape of the GXF Tensor.

std::vector<int64_t> dl_strides

Strides of the GXF Tensor. This is used to calculate the strides of the DLTensor.

© Copyright 2022-2023, NVIDIA. Last updated on Sep 13, 2023.