Compute Graph Framework SDK Reference  5.16
Exception.hpp File Reference

Go to the source code of this file.

Classes

class  dw::framework::ExceptionGuard
 

Namespaces

namespace  dw
 
namespace  dw::framework
 

Macros

#define FRWK_CHECK_CUDA_ERROR(x)
 
#define FRWK_CHECK_CUDA_ERROR_NOTHROW(x)
 
#define FRWK_CHECK_DW_ERROR(x)   FRWK_CHECK_DW_ERROR_MSG(x, GET_STRING(x));
 
#define FRWK_CHECK_DW_ERROR_IGNORE_SOME(x, fallback, ...)
 
#define FRWK_CHECK_DW_ERROR_MSG(x, description)
 
#define FRWK_CHECK_DW_ERROR_NOTHROW(x)
 
#define FRWK_CHECK_DW_ERROR_NOTHROW_IGNORE_SOME(x, fallback, ...)
 
#define FRWK_CHECK_NVMEDIA_ERROR(e)
 
#define GET_STRING(s)   #s
 
#define THROW_ON_PARAM_NULL(param)
 

Macro Definition Documentation

◆ FRWK_CHECK_CUDA_ERROR

#define FRWK_CHECK_CUDA_ERROR (   x)
Value:
{ \
x; \
cudaError_t FRWK_CHECK_CUDA_ERROR_result{cudaGetLastError()}; \
if (cudaSuccess != FRWK_CHECK_CUDA_ERROR_result) \
{ \
throw dw::core::ExceptionWithStatus(DW_CUDA_ERROR, cudaGetErrorString(FRWK_CHECK_CUDA_ERROR_result)); \
} \
};

Definition at line 117 of file Exception.hpp.

◆ FRWK_CHECK_CUDA_ERROR_NOTHROW

#define FRWK_CHECK_CUDA_ERROR_NOTHROW (   x)
Value:
{ \
x; \
cudaError_t FRWK_CHECK_CUDA_ERROR_NOTHROW_result{cudaGetLastError()}; \
if (cudaSuccess != FRWK_CHECK_CUDA_ERROR_NOTHROW_result) \
{ \
DW_LOGE << __FILE__ << ":" << __LINE__ \
<< " CUDA error but not thrown: " \
<< cudaGetErrorString(FRWK_CHECK_CUDA_ERROR_NOTHROW_result) \
<< dw::core::Logger::State::endl; \
} \
};

Definition at line 127 of file Exception.hpp.

◆ FRWK_CHECK_DW_ERROR

#define FRWK_CHECK_DW_ERROR (   x)    FRWK_CHECK_DW_ERROR_MSG(x, GET_STRING(x));

Definition at line 59 of file Exception.hpp.

◆ FRWK_CHECK_DW_ERROR_IGNORE_SOME

#define FRWK_CHECK_DW_ERROR_IGNORE_SOME (   x,
  fallback,
  ... 
)
Value:
{ \
dwStatus FRWK_CHECK_DW_ERROR_IGNORE_SOME_result{x}; \
if (DW_SUCCESS != FRWK_CHECK_DW_ERROR_IGNORE_SOME_result) \
{ \
dwStatus ignoreErros[]{__VA_ARGS__}; \
if (std::find(std::begin(ignoreErros), std::end(ignoreErros), FRWK_CHECK_DW_ERROR_IGNORE_SOME_result) != std::end(ignoreErros)) \
{ \
DW_LOGD << __FILE__ << ":" << __LINE__ \
<< " Ignoring Error: " \
<< dwGetStatusName(FRWK_CHECK_DW_ERROR_IGNORE_SOME_result) << ". Falling back on calling " << GET_STRING(fallback) \
<< dw::core::Logger::State::endl; \
FRWK_CHECK_DW_ERROR_IGNORE_SOME_result = fallback; \
if (DW_SUCCESS != FRWK_CHECK_DW_ERROR_IGNORE_SOME_result) \
{ \
throw dw::core::ExceptionWithStatus(FRWK_CHECK_DW_ERROR_IGNORE_SOME_result, "After ignoring errors from ignore list, fallback operation %s encountered DriveWorks error.", GET_STRING(fallback)); \
} \
} \
} \
if (DW_SUCCESS != FRWK_CHECK_DW_ERROR_IGNORE_SOME_result) \
{ \
throw dw::core::ExceptionWithStatus(FRWK_CHECK_DW_ERROR_IGNORE_SOME_result, "DriveWorks error not in ignore list."); \
} \
};
#define GET_STRING(s)
Definition: Exception.hpp:46

Definition at line 61 of file Exception.hpp.

◆ FRWK_CHECK_DW_ERROR_MSG

#define FRWK_CHECK_DW_ERROR_MSG (   x,
  description 
)
Value:
{ \
dwStatus FRWK_CHECK_DW_ERROR_result{x}; \
if (DW_SUCCESS != FRWK_CHECK_DW_ERROR_result) \
{ \
throw dw::core::ExceptionWithStatus(FRWK_CHECK_DW_ERROR_result, __FILE__, ":", __LINE__, " DriveWorks Error ", dwGetStatusName(FRWK_CHECK_DW_ERROR_result), ": ", description); \
} \
};

Definition at line 50 of file Exception.hpp.

◆ FRWK_CHECK_DW_ERROR_NOTHROW

#define FRWK_CHECK_DW_ERROR_NOTHROW (   x)
Value:
{ \
dwStatus FRWK_CHECK_DW_ERROR_NOTHROW_result{x}; \
if (DW_SUCCESS != FRWK_CHECK_DW_ERROR_NOTHROW_result) \
{ \
DW_LOGE << __FILE__ << ":" << __LINE__ \
<< " DriveWorks exception but not thrown: " \
<< dwGetStatusName(FRWK_CHECK_DW_ERROR_NOTHROW_result) \
<< dw::core::Logger::State::endl; \
} \
};

Definition at line 86 of file Exception.hpp.

◆ FRWK_CHECK_DW_ERROR_NOTHROW_IGNORE_SOME

#define FRWK_CHECK_DW_ERROR_NOTHROW_IGNORE_SOME (   x,
  fallback,
  ... 
)
Value:
{ \
dwStatus FRWK_CHECK_DW_ERROR_NOTHROW_IGNORE_SOME_result{x}; \
dwStatus ignoreErros[]{__VA_ARGS__}; \
if (std::find(std::begin(ignoreErros), std::end(ignoreErros), FRWK_CHECK_DW_ERROR_NOTHROW_IGNORE_SOME_result) != std::end(ignoreErros)) \
{ \
FRWK_CHECK_DW_ERROR_NOTHROW_IGNORE_SOME_result = fallback; \
} \
if (DW_SUCCESS != FRWK_CHECK_DW_ERROR_NOTHROW_IGNORE_SOME_result) \
{ \
DW_LOGE << __FILE__ << ":" << __LINE__ \
<< " DriveWorks exception but not thrown: " \
<< dwGetStatusName(FRWK_CHECK_DW_ERROR_NOTHROW_IGNORE_SOME_result) \
<< dw::core::Logger::State::endl; \
} \
};

Definition at line 98 of file Exception.hpp.

◆ FRWK_CHECK_NVMEDIA_ERROR

#define FRWK_CHECK_NVMEDIA_ERROR (   e)
Value:
{ \
NvMediaStatus FRWK_CHECK_NVMEDIA_ERROR_ret{e}; \
if (NVMEDIA_STATUS_OK != FRWK_CHECK_NVMEDIA_ERROR_ret) \
{ \
throw dw::core::ExceptionWithStatus(DW_NVMEDIA_ERROR, "NvMedia error occured"); \
} \
}

Definition at line 140 of file Exception.hpp.

◆ GET_STRING

#define GET_STRING (   s)    #s

Definition at line 46 of file Exception.hpp.

◆ THROW_ON_PARAM_NULL

#define THROW_ON_PARAM_NULL (   param)
Value:
if (nullptr == param) \
{ \
throw dw::core::ExceptionWithStatus(DW_INVALID_ARGUMENT, #param " == nullptr ", DW_FUNCTION_NAME, ":", __LINE__); \
}

Definition at line 40 of file Exception.hpp.