TensorRT 8.4.0
nvinfer1::IHostMemory Class Reference

Class to handle library allocated memory that is accessible to the user. More...

#include <NvInferRuntime.h>

Inheritance diagram for nvinfer1::IHostMemory:
nvinfer1::INoCopy

Public Member Functions

virtual ~IHostMemory () noexcept=default
 
void * data () const noexcept
 A pointer to the raw data that is owned by the library. More...
 
std::size_t size () const noexcept
 The size in bytes of the data that was allocated. More...
 
DataType type () const noexcept
 The type of the memory that was allocated. More...
 
TRT_DEPRECATED void destroy () noexcept
 

Protected Attributes

apiv::VHostMemory * mImpl
 

Additional Inherited Members

- Protected Member Functions inherited from nvinfer1::INoCopy
 INoCopy ()=default
 
virtual ~INoCopy ()=default
 
 INoCopy (const INoCopy &other)=delete
 
INoCopyoperator= (const INoCopy &other)=delete
 
 INoCopy (INoCopy &&other)=delete
 
INoCopyoperator= (INoCopy &&other)=delete
 

Detailed Description

Class to handle library allocated memory that is accessible to the user.

The memory allocated via the host memory object is owned by the library and will be de-allocated when the destroy method is called.

Warning
Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.

Constructor & Destructor Documentation

◆ ~IHostMemory()

virtual nvinfer1::IHostMemory::~IHostMemory ( )
virtualdefaultnoexcept

Member Function Documentation

◆ data()

void * nvinfer1::IHostMemory::data ( ) const
inlinenoexcept

A pointer to the raw data that is owned by the library.

◆ destroy()

TRT_DEPRECATED void nvinfer1::IHostMemory::destroy ( )
inlinenoexcept

Destroy the allocated memory.

Deprecated:
Use delete instead. Deprecated in TRT 8.0.
Warning
Calling destroy on a managed pointer will result in a double-free error.

◆ size()

std::size_t nvinfer1::IHostMemory::size ( ) const
inlinenoexcept

The size in bytes of the data that was allocated.

◆ type()

DataType nvinfer1::IHostMemory::type ( ) const
inlinenoexcept

The type of the memory that was allocated.

Member Data Documentation

◆ mImpl

apiv::VHostMemory* nvinfer1::IHostMemory::mImpl
protected

The documentation for this class was generated from the following file: