aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover/core
diff options
context:
space:
mode:
authorEdB <[email protected]>2015-04-23 20:13:51 +0200
committerTom Stellard <[email protected]>2015-04-29 14:25:42 +0000
commitd8f817ae7f4241a9ea23140805aaeb724a0ac851 (patch)
treefd6fc8f82eb32d3e4b0ba9955a0285a135b9073c /src/gallium/state_trackers/clover/core
parent5d4f085a43ccd1122301421f2013e42a3f0a7604 (diff)
clover: remove util/compat
Acked-by: Francisco Jerez <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover/core')
-rw-r--r--src/gallium/state_trackers/clover/core/compiler.hpp4
-rw-r--r--src/gallium/state_trackers/clover/core/error.hpp2
-rw-r--r--src/gallium/state_trackers/clover/core/kernel.cpp2
-rw-r--r--src/gallium/state_trackers/clover/core/module.cpp39
-rw-r--r--src/gallium/state_trackers/clover/core/module.hpp19
-rw-r--r--src/gallium/state_trackers/clover/core/program.cpp2
-rw-r--r--src/gallium/state_trackers/clover/core/program.hpp2
7 files changed, 34 insertions, 36 deletions
diff --git a/src/gallium/state_trackers/clover/core/compiler.hpp b/src/gallium/state_trackers/clover/core/compiler.hpp
index 62c0f476040..c68aa39db85 100644
--- a/src/gallium/state_trackers/clover/core/compiler.hpp
+++ b/src/gallium/state_trackers/clover/core/compiler.hpp
@@ -23,14 +23,12 @@
#ifndef CLOVER_CORE_COMPILER_HPP
#define CLOVER_CORE_COMPILER_HPP
-#include "util/compat.hpp"
#include "core/error.hpp"
#include "core/module.hpp"
#include "pipe/p_defines.h"
namespace clover {
- typedef compat::vector<std::pair<std::string,
- std::string> > header_map;
+ typedef std::vector<std::pair<std::string, std::string> > header_map;
module compile_program_llvm(const std::string &source,
const header_map &headers,
diff --git a/src/gallium/state_trackers/clover/core/error.hpp b/src/gallium/state_trackers/clover/core/error.hpp
index 805a0eceb6a..eb65d629cdd 100644
--- a/src/gallium/state_trackers/clover/core/error.hpp
+++ b/src/gallium/state_trackers/clover/core/error.hpp
@@ -27,8 +27,6 @@
#include <stdexcept>
-#include "util/compat.hpp"
-
namespace clover {
class command_queue;
class context;
diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp
index 442762c4773..0756f068553 100644
--- a/src/gallium/state_trackers/clover/core/kernel.cpp
+++ b/src/gallium/state_trackers/clover/core/kernel.cpp
@@ -192,7 +192,7 @@ kernel::exec_context::bind(intrusive_ptr<command_queue> _q,
if (st)
_q->pipe->delete_compute_state(_q->pipe, st);
- cs.prog = msec.data.begin();
+ cs.prog = &(msec.data[0]);
cs.req_local_mem = mem_local;
cs.req_input_mem = input.size();
st = q->pipe->create_compute_state(q->pipe, &cs);
diff --git a/src/gallium/state_trackers/clover/core/module.cpp b/src/gallium/state_trackers/clover/core/module.cpp
index f098b05312b..a6c5b98d8e0 100644
--- a/src/gallium/state_trackers/clover/core/module.cpp
+++ b/src/gallium/state_trackers/clover/core/module.cpp
@@ -21,6 +21,7 @@
//
#include <type_traits>
+#include <iostream>
#include "core/module.hpp"
@@ -33,20 +34,20 @@ namespace {
/// Serialize the specified object.
template<typename T>
void
- _proc(compat::ostream &os, const T &x) {
+ _proc(std::ostream &os, const T &x) {
_serializer<T>::proc(os, x);
}
/// Deserialize the specified object.
template<typename T>
void
- _proc(compat::istream &is, T &x) {
+ _proc(std::istream &is, T &x) {
_serializer<T>::proc(is, x);
}
template<typename T>
T
- _proc(compat::istream &is) {
+ _proc(std::istream &is) {
T x;
_serializer<T>::proc(is, x);
return x;
@@ -64,12 +65,12 @@ namespace {
struct _serializer<T, typename std::enable_if<
std::is_scalar<T>::value>::type> {
static void
- proc(compat::ostream &os, const T &x) {
+ proc(std::ostream &os, const T &x) {
os.write(reinterpret_cast<const char *>(&x), sizeof(x));
}
static void
- proc(compat::istream &is, T &x) {
+ proc(std::istream &is, T &x) {
is.read(reinterpret_cast<char *>(&x), sizeof(x));
}
@@ -81,11 +82,11 @@ namespace {
/// (De)serialize a vector.
template<typename T>
- struct _serializer<compat::vector<T>,
+ struct _serializer<std::vector<T>,
typename std::enable_if<
!std::is_scalar<T>::value>::type> {
static void
- proc(compat::ostream &os, const compat::vector<T> &v) {
+ proc(std::ostream &os, const std::vector<T> &v) {
_proc<uint32_t>(os, v.size());
for (size_t i = 0; i < v.size(); i++)
@@ -93,7 +94,7 @@ namespace {
}
static void
- proc(compat::istream &is, compat::vector<T> &v) {
+ proc(std::istream &is, std::vector<T> &v) {
v.resize(_proc<uint32_t>(is));
for (size_t i = 0; i < v.size(); i++)
@@ -101,7 +102,7 @@ namespace {
}
static void
- proc(module::size_t &sz, const compat::vector<T> &v) {
+ proc(module::size_t &sz, const std::vector<T> &v) {
sz += sizeof(uint32_t);
for (size_t i = 0; i < v.size(); i++)
@@ -110,25 +111,25 @@ namespace {
};
template<typename T>
- struct _serializer<compat::vector<T>,
+ struct _serializer<std::vector<T>,
typename std::enable_if<
std::is_scalar<T>::value>::type> {
static void
- proc(compat::ostream &os, const compat::vector<T> &v) {
+ proc(std::ostream &os, const std::vector<T> &v) {
_proc<uint32_t>(os, v.size());
- os.write(reinterpret_cast<const char *>(v.begin()),
+ os.write(reinterpret_cast<const char *>(&v[0]),
v.size() * sizeof(T));
}
static void
- proc(compat::istream &is, compat::vector<T> &v) {
+ proc(std::istream &is, std::vector<T> &v) {
v.resize(_proc<uint32_t>(is));
- is.read(reinterpret_cast<char *>(v.begin()),
+ is.read(reinterpret_cast<char *>(&v[0]),
v.size() * sizeof(T));
}
static void
- proc(module::size_t &sz, const compat::vector<T> &v) {
+ proc(module::size_t &sz, const std::vector<T> &v) {
sz += sizeof(uint32_t) + sizeof(T) * v.size();
}
};
@@ -137,13 +138,13 @@ namespace {
template<>
struct _serializer<std::string> {
static void
- proc(compat::ostream &os, const std::string &s) {
+ proc(std::ostream &os, const std::string &s) {
_proc<uint32_t>(os, s.size());
os.write(&s[0], s.size() * sizeof(std::string::value_type));
}
static void
- proc(compat::istream &is, std::string &s) {
+ proc(std::istream &is, std::string &s) {
s.resize(_proc<uint32_t>(is));
is.read(&s[0], s.size() * sizeof(std::string::value_type));
}
@@ -209,12 +210,12 @@ namespace {
namespace clover {
void
- module::serialize(compat::ostream &os) const {
+ module::serialize(std::ostream &os) const {
_proc(os, *this);
}
module
- module::deserialize(compat::istream &is) {
+ module::deserialize(std::istream &is) {
return _proc<module>(is);
}
diff --git a/src/gallium/state_trackers/clover/core/module.hpp b/src/gallium/state_trackers/clover/core/module.hpp
index 46112a38c91..9d656885945 100644
--- a/src/gallium/state_trackers/clover/core/module.hpp
+++ b/src/gallium/state_trackers/clover/core/module.hpp
@@ -23,7 +23,8 @@
#ifndef CLOVER_CORE_MODULE_HPP
#define CLOVER_CORE_MODULE_HPP
-#include "util/compat.hpp"
+#include <vector>
+#include <string>
namespace clover {
struct module {
@@ -40,14 +41,14 @@ namespace clover {
};
section(resource_id id, enum type type, size_t size,
- const compat::vector<char> &data) :
+ const std::vector<char> &data) :
id(id), type(type), size(size), data(data) { }
section() : id(0), type(text), size(0), data() { }
resource_id id;
type type;
size_t size;
- compat::vector<char> data;
+ std::vector<char> data;
};
struct argument {
@@ -101,22 +102,22 @@ namespace clover {
struct symbol {
symbol(const std::string &name, resource_id section,
- size_t offset, const compat::vector<argument> &args) :
+ size_t offset, const std::vector<argument> &args) :
name(name), section(section), offset(offset), args(args) { }
symbol() : name(), section(0), offset(0), args() { }
std::string name;
resource_id section;
size_t offset;
- compat::vector<argument> args;
+ std::vector<argument> args;
};
- void serialize(compat::ostream &os) const;
- static module deserialize(compat::istream &is);
+ void serialize(std::ostream &os) const;
+ static module deserialize(std::istream &is);
size_t size() const;
- compat::vector<symbol> syms;
- compat::vector<section> secs;
+ std::vector<symbol> syms;
+ std::vector<section> secs;
};
}
diff --git a/src/gallium/state_trackers/clover/core/program.cpp b/src/gallium/state_trackers/clover/core/program.cpp
index 50ac01b4ee6..0d6cc402db7 100644
--- a/src/gallium/state_trackers/clover/core/program.cpp
+++ b/src/gallium/state_trackers/clover/core/program.cpp
@@ -106,7 +106,7 @@ program::build_log(const device &dev) const {
return _logs.count(&dev) ? _logs.find(&dev)->second : "";
}
-const compat::vector<module::symbol> &
+const std::vector<module::symbol> &
program::symbols() const {
if (_binaries.empty())
throw error(CL_INVALID_PROGRAM_EXECUTABLE);
diff --git a/src/gallium/state_trackers/clover/core/program.hpp b/src/gallium/state_trackers/clover/core/program.hpp
index 661fa03102c..183145e2073 100644
--- a/src/gallium/state_trackers/clover/core/program.hpp
+++ b/src/gallium/state_trackers/clover/core/program.hpp
@@ -60,7 +60,7 @@ namespace clover {
std::string build_opts(const device &dev) const;
std::string build_log(const device &dev) const;
- const compat::vector<module::symbol> &symbols() const;
+ const std::vector<module::symbol> &symbols() const;
unsigned kernel_ref_count() const;