pulsatrix
Loading...
Searching...
No Matches
cuda_check.hpp
Go to the documentation of this file.
1
8#pragma once
9
10#include <cuda_runtime.h>
11
12#include <stdexcept>
13#include <string>
14
24#define PULSATRIX_CUDA_CHECK(call) \
25 do { \
26 cudaError_t pulsatrix_cuda_check_result = (call); \
27 if (pulsatrix_cuda_check_result != cudaSuccess) { \
28 throw std::runtime_error(std::string("CUDA error: ") + \
29 cudaGetErrorString(pulsatrix_cuda_check_result) + " at " __FILE__ + \
30 ":" + std::to_string(__LINE__)); \
31 } \
32 } while (0)