Print the latest conformance version passed reported by the device (#959)

Fixes #798

Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
Kévin Petit
2020-09-22 17:04:02 +01:00
committed by GitHub
parent fffd4f2474
commit aee9131f87
3 changed files with 16 additions and 2 deletions

View File

@@ -24,8 +24,8 @@
/* Helper to return a string containing device information for the specified
* device info parameter. */
static std::string get_device_info_string(cl_device_id device,
cl_device_info param_name)
std::string get_device_info_string(cl_device_id device,
cl_device_info param_name)
{
size_t size = 0;
int err;

View File

@@ -23,6 +23,11 @@
#include <CL/opencl.h>
/* Helper to return a string containing device information for the specified
* device info parameter. */
std::string get_device_info_string(cl_device_id device,
cl_device_info param_name);
/* Determines if an extension is supported by a device. */
int is_extension_available(cl_device_id device, const char *extensionName);

View File

@@ -1579,6 +1579,15 @@ int printDeviceHeader( cl_device_id device )
deviceName, deviceVendor, deviceVersion, ( error == CL_SUCCESS ) ? ", CL C Version = " : "",
( error == CL_SUCCESS ) ? cLangVersion : "" );
auto version = get_device_cl_version(device);
if (version >= Version(3, 0))
{
auto ctsVersion = get_device_info_string(
device, CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED);
log_info("Device latest conformance version passed: %s\n",
ctsVersion.c_str());
}
return CL_SUCCESS;
}