[Mesa-dev] [PATCH v10 19/20] clover: Advertise cl_khr_il_program
Pierre Moreau
pierre.morrow at free.fr
Tue Jan 8 21:11:08 UTC 2019
Reviewed-by: Karol Herbst <kherbst at redhat.com>
Changes since:
* v3: do not advertise SPIR-V support if CLOVER_ALLOW_SPIRV is not
defined
* v2: advertise cl_khr_il_program if if the device support NATIVE as IR
Signed-off-by: Pierre Moreau <pierre.morrow at free.fr>
---
src/gallium/state_trackers/clover/api/platform.cpp | 2 ++
src/gallium/state_trackers/clover/core/device.cpp | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/gallium/state_trackers/clover/api/platform.cpp b/src/gallium/state_trackers/clover/api/platform.cpp
index a684d34ba44..b591fe9874c 100644
--- a/src/gallium/state_trackers/clover/api/platform.cpp
+++ b/src/gallium/state_trackers/clover/api/platform.cpp
@@ -107,6 +107,8 @@ clover::GetExtensionFunctionAddress(const char *p_name) {
if (name == "clIcdGetPlatformIDsKHR")
return reinterpret_cast<void *>(IcdGetPlatformIDsKHR);
+ else if (name == "clCreateProgramWithILKHR")
+ return reinterpret_cast<void *>(CreateProgramWithILKHR);
else
return NULL;
}
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 21de0e3d61c..b9a26e4eec5 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -285,6 +285,11 @@ device::supports_ir(enum pipe_shader_ir ir) const {
std::string
device::supported_extensions() const {
+#ifdef CLOVER_ALLOW_SPIRV
+ const bool supports_il_program = supports_ir(PIPE_SHADER_IR_NATIVE);
+#else
+ const bool supports_il_program = false;
+#endif
return
"cl_khr_byte_addressable_store"
" cl_khr_global_int32_base_atomics"
@@ -294,5 +299,6 @@ device::supported_extensions() const {
+ std::string(has_int64_atomics() ? " cl_khr_int64_base_atomics" : "")
+ std::string(has_int64_atomics() ? " cl_khr_int64_extended_atomics" : "")
+ std::string(has_doubles() ? " cl_khr_fp64" : "")
- + std::string(has_halves() ? " cl_khr_fp16" : "");
+ + std::string(has_halves() ? " cl_khr_fp16" : "")
+ + std::string(supports_il_program ? " cl_khr_il_program" : "");
}
--
2.20.1
More information about the mesa-dev
mailing list