...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::compute::opencl_error — A run-time OpenCL error.
// In header: <boost/compute/exception/opencl_error.hpp> class opencl_error : public std::exception { public: // construct/copy/destruct explicit opencl_error(cl_int); ~opencl_error(); // public member functions cl_int error_code() const; std::string error_string() const; const char * what() const; // public static functions static std::string to_string(cl_int); };
The opencl_error class represents an error returned from an OpenCL function.
See Also:
opencl_error
public
construct/copy/destructexplicit opencl_error(cl_int error);Creates a new
opencl_error
exception object for error
. ~opencl_error();Destroys the
opencl_error
object. opencl_error
public static functionsstatic std::string to_string(cl_int error);
Static function which converts the numeric OpenCL error code error
to a human-readable string.
For example:
std::cout << opencl_error::to_string(CL_INVALID_KERNEL_ARGS) << std::endl;
Will print "Invalid Kernel Arguments".
If the error code is unknown (e.g. not a valid OpenCL error), a string containing "Unknown OpenCL Error" along with the error number will be returned.