19#ifndef OPM_CUDA_SAFE_CALL_HPP
20#define OPM_CUDA_SAFE_CALL_HPP
21#include <cuda_runtime.h>
23#include <opm/common/ErrorMacros.hpp>
24#include <opm/common/OpmLog/OpmLog.hpp>
51 return fmt::format(
"CUDA expression did not execute correctly. Expression was: \n"
54 "in function {}, in {}, at line {}\n",
154#define OPM_CUDA_SAFE_CALL(expression) \
155 ::Opm::cuistl::detail::cudaSafeCall(expression, #expression, __FILE__, __func__, __LINE__)
175#define OPM_CUDA_WARN_IF_ERROR(expression) \
176 ::Opm::cuistl::detail::cudaWarnIfError(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 cudaSafeCall(cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
cudaSafeCall checks the return type of the CUDA expression (function call) and throws an exception if...
Definition cuda_safe_call.hpp:82
std::string getCudaErrorMessage(cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
getCudaErrorMessage generates the error message to display for a given error.
Definition cuda_safe_call.hpp:45
cudaError_t cudaWarnIfError(cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
cudaWarnIfError checks the return type of the CUDA expression (function call) and issues a warning if...
Definition cuda_safe_call.hpp:123