Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Class opencl_error

boost::compute::opencl_error — A run-time OpenCL error.

Synopsis

// In header: <boost/compute/exception/opencl_error.hpp>


class opencl_error : public 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);
};

Description

The opencl_error class represents an error returned from an OpenCL function.

See Also:

context_error

opencl_error public construct/copy/destruct

  1. explicit opencl_error(cl_int error);
    Creates a new opencl_error exception object for error.
  2. ~opencl_error();
    Destroys the opencl_error object.

opencl_error public member functions

  1. cl_int error_code() const;
    Returns the numeric error code.
  2. std::string error_string() const;
    Returns a string description of the error.
  3. const char * what() const;
    Returns a C-string description of the error.

opencl_error public static functions

  1. static 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.


PrevUpHomeNext