clover/device: Move device_version into core and add device_clc_version
authorAaron Watry <awatry@gmail.com>
Sat, 22 Jul 2017 02:17:50 +0000 (21:17 -0500)
committerAaron Watry <awatry@gmail.com>
Sun, 6 Aug 2017 00:50:30 +0000 (19:50 -0500)
The device version is the maximum CL version that the device supports.

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.

Eventually, this will be based on the features/extensions of the actual
device, but for now move it a bit closer to its eventual destination.

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Jan Vesey <jan.vesely@rutgers.edu>
src/gallium/state_trackers/clover/api/device.cpp
src/gallium/state_trackers/clover/core/device.cpp
src/gallium/state_trackers/clover/core/device.hpp

index 0b33350bb2efe49fbe131243478c4d93e06b79ae..b1b7917e4ece3a4339fca833eea72fd971d536c4 100644 (file)
@@ -314,7 +314,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
       break;
 
    case CL_DEVICE_VERSION:
-      buf.as_string() = "OpenCL 1.1 Mesa " PACKAGE_VERSION
+      buf.as_string() = "OpenCL " + dev.device_version() + " Mesa " PACKAGE_VERSION
 #ifdef MESA_GIT_SHA1
                         " (" MESA_GIT_SHA1 ")"
 #endif
@@ -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 1.1 ";
+      buf.as_string() = "OpenCL C " + dev.device_clc_version() + " ";
       break;
 
    case CL_DEVICE_PRINTF_BUFFER_SIZE:
index 8dfba1ad9fd9882b7c28d7cf021d519ffd34633b..f6bbc38a9806ad287f56170bd48b633957b3a8d6 100644 (file)
@@ -240,3 +240,13 @@ enum pipe_endian
 device::endianness() const {
    return (enum pipe_endian)pipe->get_param(pipe, PIPE_CAP_ENDIANNESS);
 }
+
+std::string
+device::device_version() const {
+    return "1.1";
+}
+
+std::string
+device::device_clc_version() const {
+    return "1.1";
+}
index 7b3353df345d8888c395559bd6879d417a9d7b32..efc217aedb074f5fbde8916ab5a02fdac05d8a56 100644 (file)
@@ -74,6 +74,8 @@ namespace clover {
       cl_uint address_bits() const;
       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;