TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
nvinfer1::IGpuAllocator Class Referenceabstract

Application-implemented class for controlling allocation on the GPU. More...

Public Member Functions

virtual void * allocate (uint64_t size, uint64_t alignment, uint32_t flags)=0
 A callback implemented by the application to handle acquisition of GPU memory. More...
 
virtual void free (void *memory)=0
 A callback implemented by the application to handle release of GPU memory. More...
 
virtual ~IGpuAllocator ()
 Destructor declared virtual as general good practice for a class with virtual methods. More...
 

Detailed Description

Application-implemented class for controlling allocation on the GPU.

Constructor & Destructor Documentation

◆ ~IGpuAllocator()

virtual nvinfer1::IGpuAllocator::~IGpuAllocator ( )
inlinevirtual

Destructor declared virtual as general good practice for a class with virtual methods.

TensorRT never calls the destructor for an IGpuAllocator defined by the application.

Member Function Documentation

◆ allocate()

virtual void* nvinfer1::IGpuAllocator::allocate ( uint64_t  size,
uint64_t  alignment,
uint32_t  flags 
)
pure virtual

A callback implemented by the application to handle acquisition of GPU memory.

Parameters
sizeThe size of the memory required.
alignmentThe required alignment of memory. Alignment will zero or a power of 2 not exceeding the alignment guaranteed by cudaMalloc. Thus this allocator can be safely implemented with cudaMalloc/cudaFree. An alignment value of zero indicates any alignment is acceptable.
flagsReserved for future use. In the current release, 0 will be passed.

If an allocation request of size 0 is made, nullptr should be returned.

If an allocation request cannot be satisfied, nullptr should be returned.

Here is the caller graph for this function:

◆ free()

virtual void nvinfer1::IGpuAllocator::free ( void *  memory)
pure virtual

A callback implemented by the application to handle release of GPU memory.

TensorRT may pass a nullptr to this function if it was previously returned by allocate().

Parameters
memoryThe acquired memory.
Here is the caller graph for this function:

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