NVIDIA DeepStream SDK API Reference

6.2 Release
infer_defines.h File Reference

Go to the source code of this file.

Macros

#define DISABLE_CLASS_COPY(NoCopyClass)
 Copyright (c) 2020, NVIDIA CORPORATION. More...
 
#define SIMPLE_MOVE_COPY(Cls)
 
#define INFER_UNUSED(a)   (void)(a)
 
#define INFER_LOG_FORMAT_(fmt)   "%s:%d " fmt, __FILE__, __LINE__
 
#define INFER_EXPORT_API   __attribute__((__visibility__("default")))
 
#define InferError(fmt, ...)
 
#define InferWarning(fmt, ...)
 
#define InferInfo(fmt, ...)
 
#define InferDebug(fmt, ...)
 
#define RETURN_IF_FAILED(condition, ret, fmt, ...)
 
#define CHECK_NVINFER_ERROR_PRINT(err, action, logPrint, fmt, ...)
 
#define CHECK_NVINFER_ERROR(err, action, fmt, ...)   CHECK_NVINFER_ERROR_PRINT(err, action, InferError, fmt, ##__VA_ARGS__)
 
#define RETURN_NVINFER_ERROR(err, fmt, ...)   CHECK_NVINFER_ERROR(err, return ifStatus, fmt, ##__VA_ARGS__)
 
#define CONTINUE_NVINFER_ERROR(err, fmt, ...)   CHECK_NVINFER_ERROR(err, , fmt, ##__VA_ARGS__)
 
#define CHECK_CUDA_ERR_W_ACTION(err, action, logPrint, fmt, ...)
 
#define CHECK_CUDA_ERR_NO_ACTION(err, fmt, ...)   CHECK_CUDA_ERR_W_ACTION(err, , InferError, fmt, ##__VA_ARGS__)
 
#define RETURN_CUDA_ERR(err, fmt, ...)
 
#define CONTINUE_CUDA_ERR(err, fmt, ...)   CHECK_CUDA_ERR_NO_ACTION(err, fmt, ##__VA_ARGS__)
 
#define READ_SYMBOL(lib, func_name)   lib->symbol<decltype(&func_name)>(#func_name)
 
#define DIVIDE_AND_ROUND_UP(a, b)   ((a + b - 1) / b)
 
#define INFER_ROUND_UP(value, align)   (((value) + (align)-1) & (~((align)-1)))
 
#define INFER_ROUND_DOWN(value, align)   ((value) & (~((align)-1)))
 
#define INFER_WILDCARD_DIM_VALUE   -1
 
#define INFER_MEM_ALIGNMENT   1024
 

Macro Definition Documentation

◆ CHECK_CUDA_ERR_NO_ACTION

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

Definition at line 108 of file infer_defines.h.

◆ CHECK_CUDA_ERR_W_ACTION

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

Definition at line 98 of file infer_defines.h.

◆ CHECK_NVINFER_ERROR

#define CHECK_NVINFER_ERROR (   err,
  action,
  fmt,
  ... 
)    CHECK_NVINFER_ERROR_PRINT(err, action, InferError, fmt, ##__VA_ARGS__)

Definition at line 88 of file infer_defines.h.

◆ CHECK_NVINFER_ERROR_PRINT

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

Definition at line 78 of file infer_defines.h.

◆ CONTINUE_CUDA_ERR

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

Definition at line 115 of file infer_defines.h.

◆ CONTINUE_NVINFER_ERROR

#define CONTINUE_NVINFER_ERROR (   err,
  fmt,
  ... 
)    CHECK_NVINFER_ERROR(err, , fmt, ##__VA_ARGS__)

Definition at line 94 of file infer_defines.h.

◆ DISABLE_CLASS_COPY

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

Copyright (c) 2020, NVIDIA CORPORATION.

All rights reserved.

NVIDIA Corporation and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related documentation without an express license agreement from NVIDIA Corporation is strictly prohibited.

Definition at line 25 of file infer_defines.h.

◆ DIVIDE_AND_ROUND_UP

#define DIVIDE_AND_ROUND_UP (   a,
 
)    ((a + b - 1) / b)

Definition at line 121 of file infer_defines.h.

◆ INFER_EXPORT_API

#define INFER_EXPORT_API   __attribute__((__visibility__("default")))

Definition at line 44 of file infer_defines.h.

◆ INFER_LOG_FORMAT_

#define INFER_LOG_FORMAT_ (   fmt)    "%s:%d " fmt, __FILE__, __LINE__

Definition at line 41 of file infer_defines.h.

◆ INFER_MEM_ALIGNMENT

#define INFER_MEM_ALIGNMENT   1024

Definition at line 125 of file infer_defines.h.

◆ INFER_ROUND_DOWN

#define INFER_ROUND_DOWN (   value,
  align 
)    ((value) & (~((align)-1)))

Definition at line 123 of file infer_defines.h.

◆ INFER_ROUND_UP

#define INFER_ROUND_UP (   value,
  align 
)    (((value) + (align)-1) & (~((align)-1)))

Definition at line 122 of file infer_defines.h.

◆ INFER_UNUSED

#define INFER_UNUSED (   a)    (void)(a)

Definition at line 36 of file infer_defines.h.

◆ INFER_WILDCARD_DIM_VALUE

#define INFER_WILDCARD_DIM_VALUE   -1

Definition at line 124 of file infer_defines.h.

◆ InferDebug

#define InferDebug (   fmt,
  ... 
)
Value:
do { \
dsInferLogPrint__( \
NVDSINFER_LOG_DEBUG, INFER_LOG_FORMAT_(fmt), ##__VA_ARGS__); \
} while (0)

Definition at line 64 of file infer_defines.h.

◆ InferError

#define InferError (   fmt,
  ... 
)
Value:
do { \
dsInferLogPrint__( \
NVDSINFER_LOG_ERROR, INFER_LOG_FORMAT_(fmt), ##__VA_ARGS__); \
} while (0)

Definition at line 46 of file infer_defines.h.

◆ InferInfo

#define InferInfo (   fmt,
  ... 
)
Value:
do { \
dsInferLogPrint__( \
NVDSINFER_LOG_INFO, INFER_LOG_FORMAT_(fmt), ##__VA_ARGS__); \
} while (0)

Definition at line 58 of file infer_defines.h.

◆ InferWarning

#define InferWarning (   fmt,
  ... 
)
Value:
do { \
dsInferLogPrint__( \
NVDSINFER_LOG_WARNING, INFER_LOG_FORMAT_(fmt), ##__VA_ARGS__); \
} while (0)

Definition at line 52 of file infer_defines.h.

◆ READ_SYMBOL

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

Definition at line 118 of file infer_defines.h.

◆ RETURN_CUDA_ERR

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

Definition at line 111 of file infer_defines.h.

◆ RETURN_IF_FAILED

#define RETURN_IF_FAILED (   condition,
  ret,
  fmt,
  ... 
)
Value:
do { \
if (!(condition)) { \
InferError(fmt, ##__VA_ARGS__); \
return ret; \
} \
} while (0)

Definition at line 70 of file infer_defines.h.

◆ RETURN_NVINFER_ERROR

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

Definition at line 91 of file infer_defines.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 29 of file infer_defines.h.

NVDSINFER_LOG_ERROR
@ NVDSINFER_LOG_ERROR
Definition: nvdsinfer.h:247
INFER_LOG_FORMAT_
#define INFER_LOG_FORMAT_(fmt)
Definition: infer_defines.h:41
NVDSINFER_LOG_INFO
@ NVDSINFER_LOG_INFO
Definition: nvdsinfer.h:249
NvDsInferStatus2Str
const char * NvDsInferStatus2Str(NvDsInferStatus status)
Get the string name for the status.
NVDSINFER_SUCCESS
@ NVDSINFER_SUCCESS
NvDsInferContext operation succeeded.
Definition: nvdsinfer.h:219
NVDSINFER_LOG_WARNING
@ NVDSINFER_LOG_WARNING
Definition: nvdsinfer.h:248
InferError
#define InferError(fmt,...)
Definition: infer_defines.h:46
NVDSINFER_LOG_DEBUG
@ NVDSINFER_LOG_DEBUG
Definition: nvdsinfer.h:250
NVDSINFER_CUDA_ERROR
@ NVDSINFER_CUDA_ERROR
CUDA error was encountered.
Definition: nvdsinfer.h:230
CHECK_CUDA_ERR_W_ACTION
#define CHECK_CUDA_ERR_W_ACTION(err, action, logPrint, fmt,...)
Definition: infer_defines.h:98