From bd96234c4ae21b70ee144cc216d4c49f306c983f Mon Sep 17 00:00:00 2001 From: Katarzyna Kaczmarska Date: Tue, 12 May 2026 17:18:17 +0200 Subject: [PATCH] [UR][Conformance] Add logging for optional queries ASSERT_SUCCESS_OR_OPTIONAL_QUERY macro to use GTEST_SKIP() with descriptive message instead of silent return --- unified-runtime/include/unified-runtime/ur_api.h | 3 +-- unified-runtime/scripts/core/device.yml | 2 +- .../test/conformance/testing/include/uur/checks.h | 7 +++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/unified-runtime/include/unified-runtime/ur_api.h b/unified-runtime/include/unified-runtime/ur_api.h index 52c559c557fbf..7fe7a114e47ee 100644 --- a/unified-runtime/include/unified-runtime/ur_api.h +++ b/unified-runtime/include/unified-runtime/ur_api.h @@ -2204,8 +2204,7 @@ typedef enum ur_device_info_t { /// It is unsuitable for general use in applications. This feature is /// provided for identifying memory leaks. UR_DEVICE_INFO_REFERENCE_COUNT = 64, - /// [char[]][optional-query] null-terminated IL version. Optional as not - /// all adapters support IL (e.g., NativeCPU). + /// [char[]][optional-query] null-terminated IL version. UR_DEVICE_INFO_IL_VERSION = 65, /// [char[]] null-terminated device name UR_DEVICE_INFO_NAME = 66, diff --git a/unified-runtime/scripts/core/device.yml b/unified-runtime/scripts/core/device.yml index e2580da14b149..078316158fbe7 100644 --- a/unified-runtime/scripts/core/device.yml +++ b/unified-runtime/scripts/core/device.yml @@ -333,7 +333,7 @@ etors: The reference count returned should be considered immediately stale. It is unsuitable for general use in applications. This feature is provided for identifying memory leaks. - name: IL_VERSION - desc: "[char[]][optional-query] null-terminated IL version. Optional as not all adapters support IL (e.g., NativeCPU)." + desc: "[char[]][optional-query] null-terminated IL version." - name: NAME desc: "[char[]] null-terminated device name" - name: VENDOR diff --git a/unified-runtime/test/conformance/testing/include/uur/checks.h b/unified-runtime/test/conformance/testing/include/uur/checks.h index 31d0ccf0a76af..05c7d2d7e0b6a 100644 --- a/unified-runtime/test/conformance/testing/include/uur/checks.h +++ b/unified-runtime/test/conformance/testing/include/uur/checks.h @@ -92,9 +92,7 @@ inline bool stringPropertyIsValid(const char *property, #define EXPECT_SUCCESS(ACTUAL) EXPECT_EQ_RESULT(UR_RESULT_SUCCESS, ACTUAL) #endif -// This macro is intended to be used for the first call to a GetInfo query, it -// gracefully handles cases where the adapter doesn't support a query marked -// [optional-query] in the spec by returning early. +// Handles optional queries by skipping the test if the adapter doesn't support them. #ifndef ASSERT_SUCCESS_OR_OPTIONAL_QUERY #define ASSERT_SUCCESS_OR_OPTIONAL_QUERY(CALL, QUERY) \ do { \ @@ -102,7 +100,8 @@ inline bool stringPropertyIsValid(const char *property, if (result != UR_RESULT_SUCCESS) { \ ASSERT_EQ_RESULT(result, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION); \ ASSERT_TRUE(uur::isQueryOptional(QUERY)); \ - return; \ + GTEST_SKIP() << "Query " << #QUERY \ + << " is not supported by this adapter"; \ } \ } while (0) #endif