Go to the documentation of this file.
18 #ifndef viskores_cont_cuda_ErrorCuda_h
19 #define viskores_cont_cuda_ErrorCuda_h
31 #define VISKORES_CUDA_CHECK_ASYNCHRONOUS_ERROR() \
32 VISKORES_SWALLOW_SEMICOLON_PRE_BLOCK \
34 const cudaError_t viskores_cuda_check_async_error = cudaGetLastError(); \
35 if (viskores_cuda_check_async_error != cudaSuccess) \
37 throw ::viskores::cont::cuda::ErrorCuda( \
38 viskores_cuda_check_async_error, __FILE__, __LINE__, "Unchecked asynchronous error"); \
41 VISKORES_SWALLOW_SEMICOLON_POST_BLOCK
46 #define VISKORES_CUDA_CALL(command) \
47 VISKORES_CUDA_CHECK_ASYNCHRONOUS_ERROR(); \
48 VISKORES_SWALLOW_SEMICOLON_PRE_BLOCK \
50 const cudaError_t viskores_cuda_call_error = command; \
51 if (viskores_cuda_call_error != cudaSuccess) \
53 throw ::viskores::cont::cuda::ErrorCuda( \
54 viskores_cuda_call_error, __FILE__, __LINE__, #command); \
57 VISKORES_SWALLOW_SEMICOLON_POST_BLOCK
76 std::stringstream message;
77 message <<
"CUDA Error: " << cudaGetErrorString(error);
78 this->SetMessage(message.str());
82 const std::string& file,
84 const std::string& description)
86 std::stringstream message;
87 message <<
"CUDA Error: " << cudaGetErrorString(error) << std::endl
88 << description <<
" @ " << file <<
":" << line;
89 this->SetMessage(message.str());
98 #endif //viskores_cont_cuda_ErrorCuda_h
This error is thrown whenever an unidentified CUDA runtime error is encountered.
Definition: ErrorCuda.h:71
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
Groups connected points that have the same field value.
Definition: Atomic.h:27
ErrorCuda(cudaError_t error)
Definition: ErrorCuda.h:74
#define VISKORES_SILENCE_WEAK_VTABLE_WARNING_END
Definition: ExportMacros.h:128
#define VISKORES_SILENCE_WEAK_VTABLE_WARNING_START
Definition: ExportMacros.h:127
ErrorCuda(cudaError_t error, const std::string &file, viskores::Id line, const std::string &description)
Definition: ErrorCuda.h:81
The superclass of all exceptions thrown by any Viskores function or method.
Definition: Error.h:41