#include "CL/cl.h"
-#include "util/compat.hpp"
+#include <stdexcept>
+#include <string>
namespace clover {
- typedef struct _cl_command_queue command_queue;
- typedef struct _cl_context context;
+ class command_queue;
+ class context;
class device;
- typedef struct _cl_event event;
+ class event;
class hard_event;
class soft_event;
- typedef struct _cl_kernel kernel;
- typedef struct _cl_mem memory_obj;
+ class kernel;
+ class memory_obj;
class buffer;
class root_buffer;
class sub_buffer;
class image2d;
class image3d;
class platform;
- typedef struct _cl_program program;
- typedef struct _cl_sampler sampler;
+ class program;
+ class sampler;
///
/// Class that represents an error that can be converted to an
/// OpenCL status code.
///
- class error : public compat::runtime_error {
+ class error : public std::runtime_error {
public:
- error(cl_int code, compat::string what = "") :
- compat::runtime_error(what), code(code) {
+ error(cl_int code, std::string what = "") :
+ std::runtime_error(what), code(code) {
}
cl_int get() const {
cl_int code;
};
+ class invalid_build_options_error : public error {
+ public:
+ invalid_build_options_error(const std::string &what = "") :
+ error(CL_INVALID_BUILD_OPTIONS, what) {}
+ };
+
class build_error : public error {
public:
- build_error(const compat::string &log) :
- error(CL_BUILD_PROGRAM_FAILURE, log) {
- }
+ build_error(const std::string &what = "") :
+ error(CL_BUILD_PROGRAM_FAILURE, what) {}
};
template<typename O>