throw error(CL_INVALID_OPERATION);
if (!any_of(key_equals(name), headers))
- headers.push_back(compat::pair<compat::string, compat::string>(
+ headers.push_back(std::pair<compat::string, compat::string>(
name, header.source()));
},
range(header_names, num_headers),
#include "CL/cl.h"
+#include <stdexcept>
+
#include "util/compat.hpp"
namespace clover {
/// 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) {
+ std::runtime_error(what), code(code) {
}
cl_int get() const {
+++ /dev/null
-//
-// Copyright 2013 Francisco Jerez
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the "Software"),
-// to deal in the Software without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#include "util/compat.hpp"
-
-using namespace clover::compat;
-
-exception::~exception() {
-}
-
-const char *
-exception::what() const {
- return "";
-}
-
-const char *
-runtime_error::what() const {
- return _what.c_str();
-}
private:
mutable vector<char> v;
};
-
- template<typename T, typename S>
- struct pair {
- pair(T first, S second) :
- first(first), second(second) {}
-
- T first;
- S second;
- };
-
- class exception {
- public:
- exception() {}
- virtual ~exception();
-
- virtual const char *what() const;
- };
-
- class runtime_error : public exception {
- public:
- runtime_error(const string &what) : _what(what) {}
-
- virtual const char *what() const;
-
- protected:
- string _what;
- };
}
}