3 #include <boost/compute/exception/opencl_error.hpp> 9 :
std::runtime_error(to_what(error, msg))
19 if (error < CLFFT_BUGCHECK) {
20 return boost::compute::opencl_error::to_string(error);
26 case CLFFT_NOTIMPLEMENTED:
27 return "functionality is not implemented yet";
28 case CLFFT_TRANSPOSED_NOTIMPLEMENTED:
29 return "transposed functionality is not implemented" 30 " for this transformation";
31 case CLFFT_FILE_NOT_FOUND:
32 return "tried to open an existing file on the host system, but failed";
33 case CLFFT_FILE_CREATE_FAILURE:
34 return "tried to create a file on the host system, but failed";
35 case CLFFT_VERSION_MISMATCH:
36 return "version conflict between client and library";
37 case CLFFT_INVALID_PLAN:
38 return "requested plan could not be found";
39 case CLFFT_DEVICE_NO_DOUBLE:
40 return "double precision not supported on this device";
41 case CLFFT_DEVICE_MISMATCH:
42 return "attempt to run on a device using a plan" 43 " baked for a different device";
45 return "ENDSTATUS - first error code out of range";
47 return "unknown error code";
51 std::ostringstream os;
52 os << msg <<
": " <<
to_string(error) <<
" (" << error <<
")";
std::string to_what(cl_int error, char const *msg)
Generate a what() string given an error code and message.
static std::string to_string(cl_int error)
Convert error code to a string.
clfft_error(cl_int error, char const *msg)
Constructor from a clFFT error code and a message.