19#ifndef OPM_CUBLAS_SAFE_CALL_HPP
20#define OPM_CUBLAS_SAFE_CALL_HPP
24#include <opm/common/ErrorMacros.hpp>
25#include <opm/common/OpmLog/OpmLog.hpp>
34#define CHECK_CUBLAS_ERROR_TYPE(code, x) \
59 return fmt::format(
"UNKNOWN CUBLAS ERROR {}.",
code);
62#undef CHECK_CUBLAS_ERROR_TYPE
88 return fmt::format(
"cuBLAS expression did not execute correctly. Expression was: \n\n"
90 "in function {}, in {}, at line {}.\n"
91 "CuBLAS error code was: {}\n",
196#define OPM_CUBLAS_SAFE_CALL(expression) \
197 ::Opm::cuistl::detail::cublasSafeCall(expression, #expression, __FILE__, __func__, __LINE__)
216#define OPM_CUBLAS_WARN_IF_ERROR(expression) \
217 ::Opm::cuistl::detail::cublasWarnIfError(expression, #expression, __FILE__, __func__, __LINE__)
Definition AquiferInterface.hpp:35
Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading.
Definition cublas_safe_call.hpp:32
void cublasSafeCall(cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
cublasSafeCall checks the return type of the CUBLAS expression (function call) and throws an exceptio...
Definition cublas_safe_call.hpp:125
std::string getCublasErrorMessage(cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
getCublasErrorMessage generates the error message to display for a given error.
Definition cublas_safe_call.hpp:82
cublasStatus_t cublasWarnIfError(cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
cublasWarnIfError checks the return type of the CUBLAS expression (function call) and issues a warnin...
Definition cublas_safe_call.hpp:165