clover/device: Move device_version into core and add device_clc_version

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>
This commit is contained in:
Aaron Watry 2017-07-21 21:17:50 -05:00
parent 36a1b61321
commit 293b3e0a3f
3 changed files with 14 additions and 2 deletions

View 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:

View 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";
}

View 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;