Go to the documentation of this file.
10 #ifndef vtk_m_cont_cuda_ErrorCuda_h
11 #define vtk_m_cont_cuda_ErrorCuda_h
23 #define VTKM_CUDA_CHECK_ASYNCHRONOUS_ERROR() \
24 VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
26 const cudaError_t vtkm_cuda_check_async_error = cudaGetLastError(); \
27 if (vtkm_cuda_check_async_error != cudaSuccess) \
29 throw ::vtkm::cont::cuda::ErrorCuda( \
30 vtkm_cuda_check_async_error, __FILE__, __LINE__, "Unchecked asynchronous error"); \
33 VTKM_SWALLOW_SEMICOLON_POST_BLOCK
38 #define VTKM_CUDA_CALL(command) \
39 VTKM_CUDA_CHECK_ASYNCHRONOUS_ERROR(); \
40 VTKM_SWALLOW_SEMICOLON_PRE_BLOCK \
42 const cudaError_t vtkm_cuda_call_error = command; \
43 if (vtkm_cuda_call_error != cudaSuccess) \
45 throw ::vtkm::cont::cuda::ErrorCuda(vtkm_cuda_call_error, __FILE__, __LINE__, #command); \
48 VTKM_SWALLOW_SEMICOLON_POST_BLOCK
67 std::stringstream message;
68 message <<
"CUDA Error: " << cudaGetErrorString(error);
69 this->SetMessage(message.str());
73 const std::string& file,
75 const std::string& description)
77 std::stringstream message;
78 message <<
"CUDA Error: " << cudaGetErrorString(error) << std::endl
79 << description <<
" @ " << file <<
":" << line;
80 this->SetMessage(message.str());
89 #endif //vtk_m_cont_cuda_ErrorCuda_h
#define VTKM_SILENCE_WEAK_VTABLE_WARNING_START
Definition: ExportMacros.h:119
Groups connected points that have the same field value.
Definition: Atomic.h:19
ErrorCuda(cudaError_t error)
Definition: ErrorCuda.h:65
#define VTKM_SILENCE_WEAK_VTABLE_WARNING_END
Definition: ExportMacros.h:120
The superclass of all exceptions thrown by any VTKm function or method.
Definition: Error.h:33
ErrorCuda(cudaError_t error, const std::string &file, vtkm::Id line, const std::string &description)
Definition: ErrorCuda.h:72
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
This error is thrown whenever an unidentified CUDA runtime error is encountered.
Definition: ErrorCuda.h:62
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92