#include <cuda_runtime.h>
#include <fmt/core.h>
#include <opm/common/ErrorMacros.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <string_view>
Go to the source code of this file.
|
#define | OPM_GPU_SAFE_CALL(expression) ::Opm::gpuistl::detail::cudaSafeCall(expression, #expression, __FILE__, __func__, __LINE__) |
| OPM_GPU_SAFE_CALL checks the return type of the GPU expression (function call) and throws an exception if it does not equal cudaSuccess. More...
|
|
#define | OPM_GPU_WARN_IF_ERROR(expression) ::Opm::gpuistl::detail::cudaWarnIfError(expression, #expression, __FILE__, __func__, __LINE__) |
| OPM_GPU_WARN_IF_ERROR checks the return type of the GPU expression (function call) and issues a warning if it does not equal cudaSuccess. More...
|
|
|
std::string | Opm::gpuistl::detail::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. More...
|
|
void | Opm::gpuistl::detail::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 GPU expression (function call) and throws an exception if it does not equal cudaSuccess. More...
|
|
void | Opm::gpuistl::detail::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 GPU expression (function call) and issues a warning if it does not equal cudaSuccess. More...
|
|
◆ OPM_GPU_SAFE_CALL
#define OPM_GPU_SAFE_CALL |
( |
|
expression | ) |
::Opm::gpuistl::detail::cudaSafeCall(expression, #expression, __FILE__, __func__, __LINE__) |
OPM_GPU_SAFE_CALL checks the return type of the GPU expression (function call) and throws an exception if it does not equal cudaSuccess.
Example usage:
#include <cuda_runtime.h>
void some_function() {
void* somePointer;
}
#define OPM_GPU_SAFE_CALL(expression)
OPM_GPU_SAFE_CALL checks the return type of the GPU expression (function call) and throws an exceptio...
Definition: gpu_safe_call.hpp:150
- Note
- This should be used for any call to the GPU runtime API unless you have a good reason not to.
◆ OPM_GPU_WARN_IF_ERROR
#define OPM_GPU_WARN_IF_ERROR |
( |
|
expression | ) |
::Opm::gpuistl::detail::cudaWarnIfError(expression, #expression, __FILE__, __func__, __LINE__) |
OPM_GPU_WARN_IF_ERROR checks the return type of the GPU expression (function call) and issues a warning if it does not equal cudaSuccess.
Example usage:
#include <cuda_runtime.h>
void some_function() {
void* somePointer;
}
#define OPM_GPU_WARN_IF_ERROR(expression)
OPM_GPU_WARN_IF_ERROR checks the return type of the GPU expression (function call) and issues a warni...
Definition: gpu_safe_call.hpp:171
- Note
- Prefer the cudaSafeCall/OPM_GPU_SAFE_CALL counterpart unless you really don't want to throw an exception.