tu: Implement fallback linear staging blit for CopyImage
[mesa.git] / src / gallium / state_trackers / clover / core / error.hpp
index 349828100132fd53ef60adae19e1961fea9abc39..0490c19a276d42462a8db23e7849942e573c0550 100644 (file)
 
 #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;
@@ -43,17 +44,17 @@ namespace clover {
    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 {
@@ -64,11 +65,16 @@ namespace clover {
       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>