clover: report device CLC versions for 3.0

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
This commit is contained in:
Dave Airlie 2020-11-02 15:54:11 +10:00
parent 5444918098
commit 3a9fa5b36d
3 changed files with 27 additions and 0 deletions

View File

@ -413,6 +413,10 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
buf.as_scalar<cl_version>() = dev.device_version();
break;
case CL_DEVICE_OPENCL_C_ALL_VERSIONS:
buf.as_vector<cl_name_version>() = dev.opencl_c_all_versions();
break;
default:
throw error(CL_INVALID_VALUE);
}

View File

@ -365,3 +365,24 @@ cl_version
device::device_version() const {
return version;
}
cl_version
device::device_clc_version() const {
return clc_version;
}
std::vector<cl_name_version>
device::opencl_c_all_versions() const {
std::vector<cl_name_version> vec;
vec.push_back( (cl_name_version){ CL_MAKE_VERSION(1, 0, 0), "OpenCL C" } );
vec.push_back( (cl_name_version){ CL_MAKE_VERSION(1, 1, 0), "OpenCL C" } );
if (CL_VERSION_MAJOR(clc_version) == 1 &&
CL_VERSION_MINOR(clc_version) == 2)
vec.push_back( (cl_name_version){ CL_MAKE_VERSION(1, 2, 0), "OpenCL C" } );
if (CL_VERSION_MAJOR(clc_version) == 3) {
vec.push_back( (cl_name_version){ CL_MAKE_VERSION(1, 2, 0), "OpenCL C" } );
vec.push_back( (cl_name_version){ CL_MAKE_VERSION(3, 0, 0), "OpenCL C" } );
}
return vec;
}

View File

@ -92,6 +92,8 @@ namespace clover {
bool supports_ir(enum pipe_shader_ir ir) const;
std::string supported_extensions_as_string() const;
cl_version device_version() const;
cl_version device_clc_version() const;
std::vector<cl_name_version> opencl_c_all_versions() const;
friend class command_queue;
friend class root_resource;