NVIDIA DeepStream SDK API Reference

7.0 Release
nvdsinfer_func_utils.h File Reference

Go to the source code of this file.

Data Structures

class  nvdsinfer::UniquePtrWDestroy< T >
 
class  nvdsinfer::SharedPtrWDestroy< T >
 
class  nvdsinfer::DlLibHandle
 
class  nvdsinfer::GuardQueue< Container >
 

Namespaces

 nvdsinfer
 

Macros

#define DISABLE_CLASS_COPY(NoCopyClass)
 
#define SIMPLE_MOVE_COPY(Cls)
 
#define CHECK_NVINFER_ERROR(err, action, fmt, ...)
 
#define RETURN_NVINFER_ERROR(err, fmt, ...)   CHECK_NVINFER_ERROR(err, return ifStatus, fmt, ##__VA_ARGS__)
 
#define CHECK_CUDA_ERR_W_ACTION(err, action, fmt, ...)
 
#define CHECK_CUDA_ERR_NO_ACTION(err, fmt, ...)   CHECK_CUDA_ERR_W_ACTION(err, , fmt, ##__VA_ARGS__)
 
#define RETURN_CUDA_ERR(err, fmt, ...)
 
#define READ_SYMBOL(lib, func_name)   lib->symbol<decltype(&func_name)>(#func_name)
 

Functions

const char * nvdsinfer::safeStr (const char *str)
 
const char * nvdsinfer::safeStr (const std::string &str)
 
bool nvdsinfer::string_empty (const char *str)
 
bool nvdsinfer::file_accessible (const char *path)
 
bool nvdsinfer::file_accessible (const std::string &path)
 
std::string nvdsinfer::dims2Str (const nvinfer1::Dims &d)
 
std::string nvdsinfer::dims2Str (const NvDsInferDims &d)
 
std::string nvdsinfer::batchDims2Str (const NvDsInferBatchDims &d)
 
std::string nvdsinfer::dataType2Str (const nvinfer1::DataType type)
 
std::string nvdsinfer::dataType2Str (const NvDsInferDataType type)
 
std::string nvdsinfer::networkMode2Str (const NvDsInferNetworkMode type)
 
uint32_t nvdsinfer::getElementSize (NvDsInferDataType t)
 Get the size of the element from the data type. More...
 
nvinfer1::Dims nvdsinfer::ds2TrtDims (const NvDsInferDimsCHW &dims)
 
nvinfer1::Dims nvdsinfer::ds2TrtDims (const NvDsInferDims &dims)
 
NvDsInferDims nvdsinfer::trt2DsDims (const nvinfer1::Dims &dims)
 
nvinfer1::Dims nvdsinfer::CombineDimsBatch (const NvDsInferDims &dims, int batch)
 
void nvdsinfer::SplitFullDims (const nvinfer1::Dims &fullDims, NvDsInferDims &dims, int &batch)
 
void nvdsinfer::convertFullDims (const nvinfer1::Dims &fullDims, NvDsInferBatchDims &batchDims)
 
void nvdsinfer::normalizeDims (NvDsInferDims &dims)
 
bool nvdsinfer::hasWildcard (const nvinfer1::Dims &dims)
 
bool nvdsinfer::hasWildcard (const NvDsInferDims &dims)
 
bool nvdsinfer::operator<= (const nvinfer1::Dims &a, const nvinfer1::Dims &b)
 
bool nvdsinfer::operator> (const nvinfer1::Dims &a, const nvinfer1::Dims &b)
 
bool nvdsinfer::operator== (const nvinfer1::Dims &a, const nvinfer1::Dims &b)
 
bool nvdsinfer::operator!= (const nvinfer1::Dims &a, const nvinfer1::Dims &b)
 
bool nvdsinfer::operator<= (const NvDsInferDims &a, const NvDsInferDims &b)
 
bool nvdsinfer::operator> (const NvDsInferDims &a, const NvDsInferDims &b)
 
bool nvdsinfer::operator== (const NvDsInferDims &a, const NvDsInferDims &b)
 
bool nvdsinfer::operator!= (const NvDsInferDims &a, const NvDsInferDims &b)
 
bool nvdsinfer::isValidOutputFormat (const std::string &fmt)
 
bool nvdsinfer::isValidOutputDataType (const std::string &dataType)
 
nvinfer1::DataType nvdsinfer::str2DataType (const std::string &dataType)
 
uint32_t nvdsinfer::str2TensorFormat (const std::string &fmt)
 
bool nvdsinfer::validateIOTensorNames (const BuildParams &params, const nvinfer1::INetworkDefinition &network)
 
bool nvdsinfer::isValidDeviceType (const std::string &fmt)
 
bool nvdsinfer::isValidPrecisionType (const std::string &dataType)
 
nvinfer1::DataType nvdsinfer::str2PrecisionType (const std::string &dataType)
 
nvinfer1::DeviceType nvdsinfer::str2DeviceType (const std::string &deviceType)
 

Macro Definition Documentation

◆ CHECK_CUDA_ERR_NO_ACTION

#define CHECK_CUDA_ERR_NO_ACTION (   err,
  fmt,
  ... 
)    CHECK_CUDA_ERR_W_ACTION(err, , fmt, ##__VA_ARGS__)

Definition at line 69 of file nvdsinfer_func_utils.h.

◆ CHECK_CUDA_ERR_W_ACTION

#define CHECK_CUDA_ERR_W_ACTION (   err,
  action,
  fmt,
  ... 
)
Value:
do { \
cudaError_t errnum = (err); \
if (errnum != cudaSuccess) { \
dsInferError(fmt ", cuda err_no:%d, err_str:%s", ##__VA_ARGS__, \
(int)errnum, cudaGetErrorName(errnum)); \
action; \
} \
} while (0)

Definition at line 59 of file nvdsinfer_func_utils.h.

◆ CHECK_NVINFER_ERROR

#define CHECK_NVINFER_ERROR (   err,
  action,
  fmt,
  ... 
)
Value:
do { \
NvDsInferStatus ifStatus = (err); \
if (ifStatus != NVDSINFER_SUCCESS) { \
auto errStr = NvDsInferStatus2Str(ifStatus); \
dsInferError(fmt ", nvinfer error:%s", ##__VA_ARGS__, errStr); \
action; \
} \
} while (0)

Definition at line 46 of file nvdsinfer_func_utils.h.

◆ DISABLE_CLASS_COPY

#define DISABLE_CLASS_COPY (   NoCopyClass)
Value:
NoCopyClass(const NoCopyClass&) = delete; \
void operator=(const NoCopyClass&) = delete

Definition at line 35 of file nvdsinfer_func_utils.h.

◆ READ_SYMBOL

#define READ_SYMBOL (   lib,
  func_name 
)    lib->symbol<decltype(&func_name)>(#func_name)

Definition at line 76 of file nvdsinfer_func_utils.h.

◆ RETURN_CUDA_ERR

#define RETURN_CUDA_ERR (   err,
  fmt,
  ... 
)
Value:
err, return NVDSINFER_CUDA_ERROR, fmt, ##__VA_ARGS__)

Definition at line 72 of file nvdsinfer_func_utils.h.

◆ RETURN_NVINFER_ERROR

#define RETURN_NVINFER_ERROR (   err,
  fmt,
  ... 
)    CHECK_NVINFER_ERROR(err, return ifStatus, fmt, ##__VA_ARGS__)

Definition at line 56 of file nvdsinfer_func_utils.h.

◆ SIMPLE_MOVE_COPY

#define SIMPLE_MOVE_COPY (   Cls)
Value:
Cls& operator=(Cls&& o) { \
move_copy(std::move(o)); \
return *this; \
} \
Cls(Cls&& o) { move_copy(std::move(o)); }

Definition at line 39 of file nvdsinfer_func_utils.h.

NVDSINFER_SUCCESS
@ NVDSINFER_SUCCESS
NvDsInferContext operation succeeded.
Definition: nvdsinfer.h:220
CHECK_CUDA_ERR_W_ACTION
#define CHECK_CUDA_ERR_W_ACTION(err, action, fmt,...)
Definition: nvdsinfer_func_utils.h:59
NVDSINFER_CUDA_ERROR
@ NVDSINFER_CUDA_ERROR
CUDA error was encountered.
Definition: nvdsinfer.h:231
NvDsInferStatus2Str
const INFER_EXPORT_API char * NvDsInferStatus2Str(NvDsInferStatus status)
Returns the NvDsInferStatus enum name as a string.