From 3a8e86c6e6d7f57a4247921a920df32dfeb39c54 Mon Sep 17 00:00:00 2001 From: Katarzyna Kaczmarska Date: Tue, 31 Mar 2026 15:36:30 +0200 Subject: [PATCH] [UR][NativeCPU] Mark IL_VERSION as optional query NativeCPU executes native code directly without intermediate language (IL) support, so UR_DEVICE_INFO_IL_VERSION query is not applicable. Changes: 1. Mark IL_VERSION as [optional-query] in device.yml spec 2. Add explanatory comment to ur_api.h describing why this is optional 3. Add IL_VERSION to optional_queries.h list 4. Remove xfails for CUDA and NativeCPU from SuccessILVersion test 5. Add comment to test explaining why query is optional The test now correctly handles UNSUPPORTED_ENUMERATION as a valid response for adapters without IL support. --- unified-runtime/include/unified-runtime/ur_api.h | 4 +++- unified-runtime/scripts/core/device.yml | 2 +- unified-runtime/test/conformance/device/urDeviceGetInfo.cpp | 4 ++-- .../test/conformance/testing/include/uur/optional_queries.h | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/unified-runtime/include/unified-runtime/ur_api.h b/unified-runtime/include/unified-runtime/ur_api.h index 93f1d812b0bff..947180c484ab6 100644 --- a/unified-runtime/include/unified-runtime/ur_api.h +++ b/unified-runtime/include/unified-runtime/ur_api.h @@ -2203,7 +2203,9 @@ 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[]] null-terminated IL version + /// [char[]][optional-query] null-terminated IL version. This query is + /// optional because not all adapters support intermediate language (IL). For + /// example, NativeCPU executes native code directly without IL support. 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 4f98155eca8ab..7143913eadcb3 100644 --- a/unified-runtime/scripts/core/device.yml +++ b/unified-runtime/scripts/core/device.yml @@ -334,7 +334,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[]] null-terminated IL version" + desc: "[char[]][optional-query] null-terminated IL version. This query is optional because not all adapters support intermediate language (IL). For example, NativeCPU executes native code directly without IL support." - name: NAME desc: "[char[]] null-terminated device name" - name: VENDOR diff --git a/unified-runtime/test/conformance/device/urDeviceGetInfo.cpp b/unified-runtime/test/conformance/device/urDeviceGetInfo.cpp index c6e696384d2d0..31bc48f69f9e7 100644 --- a/unified-runtime/test/conformance/device/urDeviceGetInfo.cpp +++ b/unified-runtime/test/conformance/device/urDeviceGetInfo.cpp @@ -1112,9 +1112,9 @@ TEST_P(urDeviceGetInfoTest, SuccessReferenceCount) { property_value); } +// Optional query: Not all adapters support intermediate language (IL). +// NativeCPU executes native code directly without IL support. TEST_P(urDeviceGetInfoTest, SuccessILVersion) { - UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); - size_t property_size = 0; const ur_device_info_t property_name = UR_DEVICE_INFO_IL_VERSION; diff --git a/unified-runtime/test/conformance/testing/include/uur/optional_queries.h b/unified-runtime/test/conformance/testing/include/uur/optional_queries.h index 80ca9dacb593e..e118d6d4817a7 100644 --- a/unified-runtime/test/conformance/testing/include/uur/optional_queries.h +++ b/unified-runtime/test/conformance/testing/include/uur/optional_queries.h @@ -28,6 +28,7 @@ constexpr std::array optional_ur_device_info_t = { UR_DEVICE_INFO_DEVICE_ID, UR_DEVICE_INFO_MEMORY_CLOCK_RATE, UR_DEVICE_INFO_GLOBAL_MEM_FREE, + UR_DEVICE_INFO_IL_VERSION, UR_DEVICE_INFO_UUID, UR_DEVICE_INFO_PCI_ADDRESS, UR_DEVICE_INFO_GPU_EU_COUNT,