31#ifndef DW_FRAMEWORK_CHANNEL_NVSCIHELPER_HPP_
32#define DW_FRAMEWORK_CHANNEL_NVSCIHELPER_HPP_
35#include <nvscierror.h>
37#include <dw/core/base/Exception.hpp>
38#include <dw/core/logger/Logger.hpp>
51#define FRWK_CHECK_NVSCI_ERROR(e) \
53 auto FRWK_CHECK_NVSCI_ERROR_ret = (e); \
54 if (FRWK_CHECK_NVSCI_ERROR_ret != NvSciError_Success) \
56 DW_LOGE << "Failed with " << dw::framework::nvSciGetErrorName(FRWK_CHECK_NVSCI_ERROR_ret) \
57 << "(" << FRWK_CHECK_NVSCI_ERROR_ret << ")" \
58 << " in " << __FILE__ \
59 << ":" << __LINE__ << Logger::State::endl; \
60 if (FRWK_CHECK_NVSCI_ERROR_ret == NvSciError_Timeout) \
61 throw dw::core::ExceptionWithStatus(DW_TIME_OUT, "NvSci API Timeout"); \
63 throw dw::core::ExceptionWithStatus(DW_INTERNAL_ERROR, "NvSci internal error occured"); \
const char * nvSciGetEventName(uint32_t event)
const char * nvSciGetErrorName(uint32_t error)