aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/clover/core')
-rw-r--r--src/gallium/state_trackers/clover/core/kernel.cpp2
-rw-r--r--src/gallium/state_trackers/clover/core/module.hpp6
-rw-r--r--src/gallium/state_trackers/clover/core/program.cpp12
-rw-r--r--src/gallium/state_trackers/clover/core/program.hpp1
4 files changed, 18 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp
index 962f55507f6..47167053231 100644
--- a/src/gallium/state_trackers/clover/core/kernel.cpp
+++ b/src/gallium/state_trackers/clover/core/kernel.cpp
@@ -162,7 +162,7 @@ kernel::exec_context::bind(intrusive_ptr<command_queue> _q,
// Bind kernel arguments.
auto &m = kern.program().build(q->device()).binary;
auto margs = find(name_equals(kern.name()), m.syms).args;
- auto msec = find(type_equals(module::section::text), m.secs);
+ auto msec = find(type_equals(module::section::text_executable), m.secs);
auto explicit_arg = kern._args.begin();
for (auto &marg : margs) {
diff --git a/src/gallium/state_trackers/clover/core/module.hpp b/src/gallium/state_trackers/clover/core/module.hpp
index 5db0548872c..2ddd26426fb 100644
--- a/src/gallium/state_trackers/clover/core/module.hpp
+++ b/src/gallium/state_trackers/clover/core/module.hpp
@@ -33,7 +33,9 @@ namespace clover {
struct section {
enum type {
- text,
+ text_intermediate,
+ text_library,
+ text_executable,
data_constant,
data_global,
data_local,
@@ -43,7 +45,7 @@ namespace clover {
section(resource_id id, enum type type, size_t size,
const std::vector<char> &data) :
id(id), type(type), size(size), data(data) { }
- section() : id(0), type(text), size(0), data() { }
+ section() : id(0), type(text_intermediate), size(0), data() { }
resource_id id;
type type;
diff --git a/src/gallium/state_trackers/clover/core/program.cpp b/src/gallium/state_trackers/clover/core/program.cpp
index 79ac85117e3..ae4b50a8797 100644
--- a/src/gallium/state_trackers/clover/core/program.cpp
+++ b/src/gallium/state_trackers/clover/core/program.cpp
@@ -108,6 +108,18 @@ program::build::status() const {
return CL_BUILD_NONE;
}
+cl_program_binary_type
+program::build::binary_type() const {
+ if (any_of(type_equals(module::section::text_intermediate), binary.secs))
+ return CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT;
+ else if (any_of(type_equals(module::section::text_library), binary.secs))
+ return CL_PROGRAM_BINARY_TYPE_LIBRARY;
+ else if (any_of(type_equals(module::section::text_executable), binary.secs))
+ return CL_PROGRAM_BINARY_TYPE_EXECUTABLE;
+ else
+ return CL_PROGRAM_BINARY_TYPE_NONE;
+}
+
const struct program::build &
program::build(const device &dev) const {
static const struct build null;
diff --git a/src/gallium/state_trackers/clover/core/program.hpp b/src/gallium/state_trackers/clover/core/program.hpp
index 76f16d2f9f1..05964e78a79 100644
--- a/src/gallium/state_trackers/clover/core/program.hpp
+++ b/src/gallium/state_trackers/clover/core/program.hpp
@@ -63,6 +63,7 @@ namespace clover {
const std::string &log = {}) : binary(m), opts(opts), log(log) {}
cl_build_status status() const;
+ cl_program_binary_type binary_type() const;
module binary;
std::string opts;