[Mesa-dev] [PATCH 2/8] clover: Add device_clc_version to device.[hc]pp

Aaron Watry awatry at gmail.com
Mon Jul 31 01:26:06 UTC 2017


device_version and device_clc_version are not necessarily the same for
devices that support CL 1.0, but have a 1.1 compiler and the necessary
extensions.

CC: Jan Vesey <jan.vesely at rutgers.edu>
---
 src/gallium/state_trackers/clover/api/device.cpp  | 2 +-
 src/gallium/state_trackers/clover/core/device.cpp | 5 +++++
 src/gallium/state_trackers/clover/core/device.hpp | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
index 18ed2f059f..b1b7917e4e 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -368,7 +368,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
       break;
 
    case CL_DEVICE_OPENCL_C_VERSION:
-      buf.as_string() = "OpenCL C " + dev.device_version() + " ";
+      buf.as_string() = "OpenCL C " + dev.device_clc_version() + " ";
       break;
 
    case CL_DEVICE_PRINTF_BUFFER_SIZE:
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 0277495506..68856ae36b 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -245,3 +245,8 @@ std::string
 device::device_version() const {
     return "1.1";
 }
+
+std::string
+device::device_clc_version() const {
+    return "1.1";
+}
diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp
index 3cf7e20be5..efc217aedb 100644
--- a/src/gallium/state_trackers/clover/core/device.hpp
+++ b/src/gallium/state_trackers/clover/core/device.hpp
@@ -75,6 +75,7 @@ namespace clover {
       std::string device_name() const;
       std::string vendor_name() const;
       std::string device_version() const;
+      std::string device_clc_version() const;
       enum pipe_shader_ir ir_format() const;
       std::string ir_target() const;
       enum pipe_endian endianness() const;
-- 
2.11.0



More information about the mesa-dev mailing list