summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover/api
diff options
context:
space:
mode:
authorSerge Martin <[email protected]>2016-10-30 17:21:15 -0700
committerSerge Martin <[email protected]>2016-11-06 15:56:54 +0100
commitcc495055cdfe7e39002180d095d09fe4b6905eb9 (patch)
tree0ac1320ce58a9a14f5dcefae3e62c1dfa1b37196 /src/gallium/state_trackers/clover/api
parent05fcc73f087fa2b8c447ec8c79c7bdab57d49faf (diff)
clover: Add CL_PROGRAM_BINARY_TYPE support (CL1.2).
v3 [Francisco Jerez]: Loosely based on Serge's v1 of this patch in order to avoid CL-specific enums in the clover module binary format. In addition to other changes made in v2: Represent the CL program binary type as the section type instead of adding a CL API-specific enum, check that the binary types of the input objects are valid during clLinkProgram(), pass section type as argument to build_module_library() instead of using separate function. Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover/api')
-rw-r--r--src/gallium/state_trackers/clover/api/program.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
index ba4ce7a0c4a..9d59668f8f6 100644
--- a/src/gallium/state_trackers/clover/api/program.cpp
+++ b/src/gallium/state_trackers/clover/api/program.cpp
@@ -248,7 +248,9 @@ namespace {
for (auto &dev : all_devs) {
const auto has_binary = [&](const program &prog) {
- return !prog.build(dev).binary.secs.empty();
+ const auto t = prog.build(dev).binary_type();
+ return t == CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT ||
+ t == CL_PROGRAM_BINARY_TYPE_LIBRARY;
};
// According to the CL 1.2 spec, when "all programs specified [..]
@@ -405,6 +407,10 @@ clGetProgramBuildInfo(cl_program d_prog, cl_device_id d_dev,
buf.as_string() = prog.build(dev).log;
break;
+ case CL_PROGRAM_BINARY_TYPE:
+ buf.as_scalar<cl_program_binary_type>() = prog.build(dev).binary_type();
+ break;
+
default:
throw error(CL_INVALID_VALUE);
}