22 #ifndef KJB_CPP_GPU_OPENCL_H
23 #define KJB_CPP_GPU_OPENCL_H
27 #ifdef KJB_HAVE_OPENCL
29 #include <OpenCL/opencl.h>
40 throw ::kjb::gpu::Opencl_error(__err, __FILE__, __LINE__); \
44 #define CL_ETX_2(a, msg) \
49 throw ::kjb::gpu::Opencl_error(__err, msg, __FILE__, __LINE__); \
59 std::cerr << "OpenCL error: " << kjb::gpu::get_opencl_error_string(__err) << std::endl; \
70 const char* get_opencl_error_string(cl_int err);
75 Opencl_error(cl_int code,
const char* file,
int line) :
76 Runtime_error(get_opencl_error_string(code), file, line),
80 Opencl_error(cl_int code,
const std::string& message,
const char* file,
int line) :
81 Runtime_error(message, file, line),
85 Opencl_error(
const std::string& message,
const char* file,
int line) :
86 Runtime_error(message, file, line),
90 cl_int get_error_code()
const
Support for error handling exception classes in libKJB.
Object thrown when computation fails somehow during execution.
Definition: l_exception.h:321