Class GXFMemoryBuffer

Clara Holoscan v0.4.0

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 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, NVIDIA. Last updated on Jun 28, 2023.