NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/includes/ds3d/common/defines.h File Reference

Go to the source code of this file.

Macros

#define ENABLE_DEBUG   NvDs3dEnableDebug()
 
#define DS3D_DISABLE_CLASS_COPY(NoCopyClass)
 
#define DS_ASSERT(...)   assert((__VA_ARGS__))
 
#define DS3D_FORMAT_(fmt, ...)   "%s:%d, " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__
 
#define DS3D_LOG_PRINT_(out, level, fmt, ...)
 
#define LOG_PRINT(fmt, ...)
 
#define LOG_DEBUG(fmt, ...)
 
#define LOG_ERROR(fmt, ...)   DS3D_LOG_PRINT_(stderr, ERROR, fmt, ##__VA_ARGS__)
 
#define LOG_WARNING(fmt, ...)   DS3D_LOG_PRINT_(stderr, WARNING, fmt, ##__VA_ARGS__)
 
#define LOG_INFO(fmt, ...)   DS3D_LOG_PRINT_(stdout, INFO, fmt, ##__VA_ARGS__)
 
#define DS3D_FAILED_RETURN(condition, ret, fmt, ...)
 
#define DS3D_ERROR_RETURN(code, fmt, ...)
 
#define DS3D_THROW_ERROR(statement, code, msg)
 
#define DS3D_THROW_ERROR_FMT(statement, code, fmt, ...)
 
#define DS3D_CHECK_CUDA_ERROR(err, action, fmt, ...)
 
#define DS3D_UNUSED(a)   (void)(a)
 
#define DS3D_TRY   try
 
#define DS3D_CATCH_ERROR(type, errcode, fmt, ...)
 
#define DS3D_CATCH_ANY(errcode, fmt, ...)
 
#define DS3D_EXPORT_API   __attribute__((__visibility__("default")))
 
#define DS3D_EXTERN_C_BEGIN   extern "C" {
 
#define DS3D_EXTERN_C_END   }
 
#define DS3D_STR_PREFIX   "DS3D::"
 
#define DS3D_KEY_NAME(name)   DS3D_STR_PREFIX name
 
#define REGISTER_TYPE_ID(uint64Id)   static constexpr TIdType __typeid() { return uint64Id; }
 
#define DS3D_ROUND_UP(value, align)   (((value) + (align)-1) & (~((align)-1)))
 

Macro Definition Documentation

◆ DS3D_CATCH_ANY

#define DS3D_CATCH_ANY (   errcode,
  fmt,
  ... 
)
Value:
catch (...) \
{ \
LOG_ERROR(fmt ", catched unknown error", ##__VA_ARGS__); \
return errcode; \
}

Definition at line 122 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_CATCH_ERROR

#define DS3D_CATCH_ERROR (   type,
  errcode,
  fmt,
  ... 
)
Value:
catch (const type& e) \
{ \
LOG_ERROR(fmt ", catched " #type ": %s", ##__VA_ARGS__, e.what()); \
return errcode; \
}

Definition at line 115 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_CHECK_CUDA_ERROR

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

Definition at line 95 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_DISABLE_CLASS_COPY

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

Definition at line 30 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_ERROR_RETURN

#define DS3D_ERROR_RETURN (   code,
  fmt,
  ... 
)
Value:
do { \
ErrCode __cd = (code); \
DS3D_FAILED_RETURN(isGood(__cd), __cd, fmt, ##__VA_ARGS__); \
} while (0)

Definition at line 77 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_EXPORT_API

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

Definition at line 129 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_EXTERN_C_BEGIN

#define DS3D_EXTERN_C_BEGIN   extern "C" {

Definition at line 130 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_EXTERN_C_END

#define DS3D_EXTERN_C_END   }

Definition at line 131 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_FAILED_RETURN

#define DS3D_FAILED_RETURN (   condition,
  ret,
  fmt,
  ... 
)
Value:
do { \
if (!(condition)) { \
LOG_ERROR(fmt ", check failure", ##__VA_ARGS__); \
return (ret); \
} \
} while (0)

Definition at line 69 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_FORMAT_

#define DS3D_FORMAT_ (   fmt,
  ... 
)    "%s:%d, " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__

Definition at line 41 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_KEY_NAME

#define DS3D_KEY_NAME (   name)    DS3D_STR_PREFIX name

Definition at line 134 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_LOG_PRINT_

#define DS3D_LOG_PRINT_ (   out,
  level,
  fmt,
  ... 
)
Value:
fprintf(out, DS3D_FORMAT_(#level ": " fmt, ##__VA_ARGS__)); \
fflush(out)

Definition at line 45 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_ROUND_UP

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

Definition at line 140 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_STR_PREFIX

#define DS3D_STR_PREFIX   "DS3D::"

Definition at line 133 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_THROW_ERROR

#define DS3D_THROW_ERROR (   statement,
  code,
  msg 
)
Value:
if (!(statement)) { \
throwError(code, msg); \
}

Definition at line 83 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_THROW_ERROR_FMT

#define DS3D_THROW_ERROR_FMT (   statement,
  code,
  fmt,
  ... 
)
Value:
if (!(statement)) { \
char __smsg[2048] = {0}; \
snprintf(__smsg, sizeof(__smsg) - 1, fmt, ##__VA_ARGS__); \
throwError(code, __smsg); \
}

Definition at line 88 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_TRY

#define DS3D_TRY   try

Definition at line 113 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS3D_UNUSED

#define DS3D_UNUSED (   a)    (void)(a)

Definition at line 106 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ DS_ASSERT

#define DS_ASSERT (   ...)    assert((__VA_ARGS__))

Definition at line 36 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ ENABLE_DEBUG

#define ENABLE_DEBUG   NvDs3dEnableDebug()

Definition at line 27 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ LOG_DEBUG

#define LOG_DEBUG (   fmt,
  ... 
)
Value:
if (ENABLE_DEBUG) { \
DS3D_LOG_PRINT_(stdout, DEBUG, fmt, ##__VA_ARGS__); \
}

Definition at line 59 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ LOG_ERROR

#define LOG_ERROR (   fmt,
  ... 
)    DS3D_LOG_PRINT_(stderr, ERROR, fmt, ##__VA_ARGS__)

Definition at line 64 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ LOG_INFO

#define LOG_INFO (   fmt,
  ... 
)    DS3D_LOG_PRINT_(stdout, INFO, fmt, ##__VA_ARGS__)

Definition at line 66 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ LOG_PRINT

#define LOG_PRINT (   fmt,
  ... 
)
Value:
fprintf(stdout, fmt, ##__VA_ARGS__); \
fflush(stdout)

Definition at line 55 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ LOG_WARNING

#define LOG_WARNING (   fmt,
  ... 
)    DS3D_LOG_PRINT_(stderr, WARNING, fmt, ##__VA_ARGS__)

Definition at line 65 of file 9.1/sources/includes/ds3d/common/defines.h.

◆ REGISTER_TYPE_ID

#define REGISTER_TYPE_ID (   uint64Id)    static constexpr TIdType __typeid() { return uint64Id; }

Definition at line 136 of file 9.1/sources/includes/ds3d/common/defines.h.

ds3d::isGood
bool isGood(ErrCode c)
Definition: sources/includes/ds3d/common/func_utils.h:32
ENABLE_DEBUG
#define ENABLE_DEBUG
Definition: 9.1/sources/includes/ds3d/common/defines.h:27
DS3D_FORMAT_
#define DS3D_FORMAT_(fmt,...)
Definition: 9.1/sources/includes/ds3d/common/defines.h:41