API
 
Loading...
Searching...
No Matches
buffers.hpp File Reference
#include "/opt/MagAOX/vendor/TensorRT-10.0.0.6/include/NvInfer.h"
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <cuda_runtime_api.h>
#include <iostream>
#include <iterator>
#include <memory>
#include <new>
#include <numeric>
#include <string>
#include <vector>
Include dependency graph for buffers.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GenericBuffer< AllocFunc, FreeFunc >
 The GenericBuffer class is a templated class for buffers. More...
 
class  DeviceAllocator
 
class  DeviceFree
 
class  HostAllocator
 
class  HostFree
 
class  ManagedBuffer
 The ManagedBuffer class groups together a pair of corresponding device and host buffers. More...
 
class  BufferManager
 The BufferManager class handles host and device buffer allocation and deallocation. More...
 

Macros

#define CHECK(status)
 

Typedefs

using DeviceBuffer = GenericBuffer< DeviceAllocator, DeviceFree >
 
using HostBuffer = GenericBuffer< HostAllocator, HostFree >
 

Functions

template<typename A , typename B >
divUp (A x, B n)
 Return m rounded up to nearest multiple of n.
 
template<typename T1 , typename T2 >
T1 roundUp (T1 m, T2 n)
 
int64_t volume (nvinfer1::Dims const &d)
 
uint32_t getElementSize (nvinfer1::DataType t) noexcept
 

Class Documentation

◆ ManagedBuffer

class ManagedBuffer

The ManagedBuffer class groups together a pair of corresponding device and host buffers.

Definition at line 273 of file buffers.hpp.

Collaboration diagram for ManagedBuffer:
Collaboration graph
Class Members
DeviceBuffer deviceBuffer
HostBuffer hostBuffer

Macro Definition Documentation

◆ CHECK

#define CHECK (   status)
Value:
do \
{ \
auto ret = (status); \
if (ret != 0) \
{ \
std::cerr << "Cuda failure: " << ret << std::endl; \
exit(EXIT_FAILURE); \
} \
} while (0)

Definition at line 35 of file buffers.hpp.

Typedef Documentation

◆ DeviceBuffer

Definition at line 267 of file buffers.hpp.

◆ HostBuffer

Definition at line 268 of file buffers.hpp.

Function Documentation

◆ divUp()

template<typename A , typename B >
A divUp ( x,
n 
)
inline

Return m rounded up to nearest multiple of n.

Definition at line 48 of file buffers.hpp.

Referenced by BufferManager::BufferManager().

◆ getElementSize()

uint32_t getElementSize ( nvinfer1::DataType  t)
inlinenoexcept

Definition at line 68 of file buffers.hpp.

Referenced by GenericBuffer< AllocFunc, FreeFunc >::nbBytes().

◆ roundUp()

template<typename T1 , typename T2 >
T1 roundUp ( T1  m,
T2  n 
)
inline

Definition at line 54 of file buffers.hpp.

◆ volume()

int64_t volume ( nvinfer1::Dims const &  d)
inline