Skip to content

Commit 05cb24b

Browse files
kekaczmabb-ur
authored andcommitted
Mark IL_VERSION as optional query (#21661)
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 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.
1 parent 9bf1de7 commit 05cb24b

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

include/unified-runtime/ur_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,8 @@ typedef enum ur_device_info_t {
22042204
/// It is unsuitable for general use in applications. This feature is
22052205
/// provided for identifying memory leaks.
22062206
UR_DEVICE_INFO_REFERENCE_COUNT = 64,
2207-
/// [char[]] null-terminated IL version
2207+
/// [char[]][optional-query] null-terminated IL version. Optional as not
2208+
/// all adapters support IL (e.g., NativeCPU).
22082209
UR_DEVICE_INFO_IL_VERSION = 65,
22092210
/// [char[]] null-terminated device name
22102211
UR_DEVICE_INFO_NAME = 66,

scripts/core/device.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ etors:
333333
The reference count returned should be considered immediately stale.
334334
It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.
335335
- name: IL_VERSION
336-
desc: "[char[]] null-terminated IL version"
336+
desc: "[char[]][optional-query] null-terminated IL version. Optional as not all adapters support IL (e.g., NativeCPU)."
337337
- name: NAME
338338
desc: "[char[]] null-terminated device name"
339339
- name: VENDOR

test/conformance/device/urDeviceGetInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,9 +1145,9 @@ TEST_P(urDeviceGetInfoTest, SuccessReferenceCount) {
11451145
property_value);
11461146
}
11471147

1148+
// Optional query: Not all adapters support intermediate language (IL).
1149+
// NativeCPU executes native code directly without IL support.
11481150
TEST_P(urDeviceGetInfoTest, SuccessILVersion) {
1149-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
1150-
11511151
size_t property_size = 0;
11521152
const ur_device_info_t property_name = UR_DEVICE_INFO_IL_VERSION;
11531153

test/conformance/testing/include/uur/optional_queries.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)