|
NVIDIA DeepStream SDK API Reference
|
7.1 Release
|
Go to the documentation of this file.
20 #ifndef __NVDSINFER_CUDA_UTILS_H__
21 #define __NVDSINFER_CUDA_UTILS_H__
24 #include <condition_variable>
30 #include <cuda_runtime_api.h>
42 uint flag = cudaStreamDefault,
int gpuId = 0,
int priority = 0);
45 int devId()
const {
return m_GpuId; }
51 m_Stream = o.m_Stream;
65 explicit CudaEvent(uint flag = cudaEventDefault,
int gpuId = 0);
67 operator cudaEvent_t() {
return m_Event; }
68 int devId()
const {
return m_GpuId; }
69 cudaEvent_t&
ptr() {
return m_Event; }
80 cudaEvent_t m_Event =
nullptr;
136 void _allocate(
size_t bytes);
149 void _allocate(
size_t bytes);
162 std::vector<uint8_t> m_Data;
171 const std::string& name,
InferMemType mt,
int devId,
bool initCuEvent);
176 assert(size <= m_MaxBatchSize);
181 void*
getBufPtr(uint32_t batchIdx)
const final;
190 uint32_t m_MaxBatchSize = 0;
208 int batchSize,
const std::string& name,
InferMemType mt,
int devId,
225 InferDataType dt,
int batchSize,
const std::string& name =
"",
226 int devId = 0,
bool initCuEvent =
false);
242 InferDataType dt,
int batchSize,
const std::string& name =
"",
243 int devId = 0,
bool initCuEvent =
false);
This is a header file for pre-processing cuda kernels with normalization and mean subtraction require...
InferDataType
Datatype of the tensor buffer.
Allocates and manages CUDA pinned memory.
#define SIMPLE_MOVE_COPY(Cls)
void grow(size_t bytes) override
UniqCudaTensorBuf createTensorBuf(const InferDims &dims, InferDataType dt, int batchSize, const std::string &name, InferMemType mt, int devId, bool initCuEvent)
Create a tensor buffer of the specified memory type, dimensions on the given device.
CudaEvent(uint flag=cudaEventDefault, int gpuId=0)
virtual ~SysMem()=default
Header file of batch buffer related class declarations.
void grow(size_t bytes) override
InferMemType type() const
Wrapper class for CUDA events.
virtual void setBatchSize(uint32_t size)
void setName(const std::string &name)
std::unique_ptr< CudaTensorBuf > UniqCudaTensorBuf
Wrapper class for CUDA streams.
Header file of the common declarations for the nvinferserver library.
Helper class for managing Cuda Streams.
virtual void grow(size_t bytes)=0
void move_copy(SysMem &&o)
~CudaTensorBuf() override
UniqCudaTensorBuf createGpuTensorBuf(const InferDims &dims, InferDataType dt, int batchSize, const std::string &name="", int devId=0, bool initCuEvent=false)
Create a CUDA device memory tensor buffer of specified dimensions on the given device.
UniqCudaTensorBuf createCpuTensorBuf(const InferDims &dims, InferDataType dt, int batchSize, const std::string &name="", int devId=0, bool initCuEvent=false)
Create a CUDA pinned memory tensor buffer of specified dimensions on the given device.
NvDsInferStatus syncAllCudaEvents(const SharedBatchArray &bufList)
Synchronize on all events associated with the batch buffer array.
void setBatchSize(uint32_t size) override
Allocates and manages host memory.
~CudaDeviceMem() override
Base class for managing memory allocation.
void * getBufPtr(uint32_t batchIdx) const final
InferMemType
The memory types of inference buffers.
Holds the information about the dimensions of a neural network layer.
CudaDeviceMem(size_t size, int gpuId=0)
void grow(size_t bytes) override
CudaTensorBuf(const InferDims &dims, InferDataType dt, int batchSize, const std::string &name, InferMemType mt, int devId, bool initCuEvent)
The base class for batch buffers.
CudaStream(uint flag=cudaStreamDefault, int gpuId=0, int priority=0)
A batch buffer with CUDA memory allocation.
InferBufferDescription & mutableBufDesc()
Allocates and manages CUDA device memory.
CudaHostMem(size_t size, int gpuId=0)
DISABLE_CLASS_COPY(SysMem)
std::shared_ptr< BaseBatchArray > SharedBatchArray
SysMem(size_t s, int devId)
std::unique_ptr< SysMem > UniqSysMem
std::string name
Name of the buffer.
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.