19#ifndef OPM_CUSPARSE_SAFE_CALL_HPP
20#define OPM_CUSPARSE_SAFE_CALL_HPP
24#include <opm/common/ErrorMacros.hpp>
25#include <opm/common/OpmLog/OpmLog.hpp>
30#define CHECK_CUSPARSE_ERROR_TYPE(code, x) \
54 return fmt::format(
"UNKNOWN CUSPARSE ERROR {}.",
code);
57#undef CHECK_CUSPARSE_ERROR_TYPE
80 return fmt::format(
"cuSparse expression did not execute correctly. Expression was: \n\n"
81 " {}\n\nin function {}, in {}, at line {}\n"
82 "CuSparse error code was: {}\n",
185#define OPM_CUSPARSE_SAFE_CALL(expression) \
186 ::Opm::gpuistl::detail::cusparseSafeCall(expression, #expression, __FILE__, __func__, __LINE__)
206#define OPM_CUSPARSE_WARN_IF_ERROR(expression) \
207 ::Opm::gpuistl::detail::cusparseWarnIfError(expression, #expression, __FILE__, __func__, __LINE__)
Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading.
Definition autotuner.hpp:29
std::string getCusparseErrorCodeToString(int code)
getCusparseErrorCodeToString Converts an error code returned from a cusparse function a human readabl...
Definition cusparse_safe_call.hpp:40
void cusparseSafeCall(cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
cusparseSafeCall checks the return type of the CUSPARSE expression (function call) and throws an exce...
Definition cusparse_safe_call.hpp:111
cusparseStatus_t cusparseWarnIfError(cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
cusparseWarnIfError checks the return type of the CUSPARSE expression (function call) and issues a wa...
Definition cusparse_safe_call.hpp:152
std::string getCusparseErrorMessage(cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
getCusparseErrorMessage generates the error message to display for a given error.
Definition cusparse_safe_call.hpp:74
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242