summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover
diff options
context:
space:
mode:
authorPierre Moreau <[email protected]>2018-01-21 18:49:00 +0100
committerKarol Herbst <[email protected]>2019-02-26 21:02:07 +0100
commitb033620abf7ed96fcdc9fef272829bd8688a5ae4 (patch)
treeebf9a9f6be4420f5d16ea8b26d74bcf343a34c63 /src/gallium/state_trackers/clover
parentd42f5896c52cfc616bce022e90e9c0ade2a982c0 (diff)
clover: Move device extensions definitions to core/device.cpp
Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Aaron Watry <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover')
-rw-r--r--src/gallium/state_trackers/clover/api/device.cpp11
-rw-r--r--src/gallium/state_trackers/clover/core/device.cpp14
-rw-r--r--src/gallium/state_trackers/clover/core/device.hpp1
3 files changed, 16 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
index 5a4f94c1141..ca6b90ba271 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -326,16 +326,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
break;
case CL_DEVICE_EXTENSIONS:
- buf.as_string() =
- "cl_khr_byte_addressable_store"
- " cl_khr_global_int32_base_atomics"
- " cl_khr_global_int32_extended_atomics"
- " cl_khr_local_int32_base_atomics"
- " cl_khr_local_int32_extended_atomics"
- + std::string(dev.has_int64_atomics() ? " cl_khr_int64_base_atomics" : "")
- + std::string(dev.has_int64_atomics() ? " cl_khr_int64_extended_atomics" : "")
- + std::string(dev.has_doubles() ? " cl_khr_fp64" : "")
- + std::string(dev.has_halves() ? " cl_khr_fp16" : "");
+ buf.as_string() = dev.supported_extensions();
break;
case CL_DEVICE_PLATFORM:
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 010bae81403..0c02039eba7 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -278,3 +278,17 @@ device::supports_ir(enum pipe_shader_ir ir) const {
return pipe->get_shader_param(pipe, PIPE_SHADER_COMPUTE,
PIPE_SHADER_CAP_SUPPORTED_IRS) & (1 << ir);
}
+
+std::string
+device::supported_extensions() const {
+ return
+ "cl_khr_byte_addressable_store"
+ " cl_khr_global_int32_base_atomics"
+ " cl_khr_global_int32_extended_atomics"
+ " cl_khr_local_int32_base_atomics"
+ " cl_khr_local_int32_extended_atomics"
+ + 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" : "");
+}
diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp
index ebe15f28e93..a7084e863f4 100644
--- a/src/gallium/state_trackers/clover/core/device.hpp
+++ b/src/gallium/state_trackers/clover/core/device.hpp
@@ -83,6 +83,7 @@ namespace clover {
std::string ir_target() const;
enum pipe_endian endianness() const;
bool supports_ir(enum pipe_shader_ir ir) const;
+ std::string supported_extensions() const;
friend class command_queue;
friend class root_resource;