From aee9131f8708df172be5dda68cd50bbdcb0b33c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Petit?= Date: Tue, 22 Sep 2020 17:04:02 +0100 Subject: [PATCH] Print the latest conformance version passed reported by the device (#959) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #798 Signed-off-by: Kévin Petit --- test_common/harness/deviceInfo.cpp | 4 ++-- test_common/harness/deviceInfo.h | 5 +++++ test_common/harness/kernelHelpers.cpp | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/test_common/harness/deviceInfo.cpp b/test_common/harness/deviceInfo.cpp index 96a04f9a..83db2926 100644 --- a/test_common/harness/deviceInfo.cpp +++ b/test_common/harness/deviceInfo.cpp @@ -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; diff --git a/test_common/harness/deviceInfo.h b/test_common/harness/deviceInfo.h index 87afdc60..300c6d38 100644 --- a/test_common/harness/deviceInfo.h +++ b/test_common/harness/deviceInfo.h @@ -23,6 +23,11 @@ #include +/* 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); diff --git a/test_common/harness/kernelHelpers.cpp b/test_common/harness/kernelHelpers.cpp index f4a50169..2139821a 100644 --- a/test_common/harness/kernelHelpers.cpp +++ b/test_common/harness/kernelHelpers.cpp @@ -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; }