Skip to content

Commit 5c8bd26

Browse files
committed
Update docs, rename macro.
1 parent 5949a72 commit 5c8bd26

26 files changed

+59
-49
lines changed

scripts/YaML.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ plural form *enumerators* is abbreviated to `etors`.
336336
- An etor requires the following scalar fields: {`name`, `desc`}
337337
+ `desc` will be used as the etors's description comment
338338
+ If the enum has `typed_etors`, `desc` must begin with type identifier: {`"[type]"`}
339+
+ `desc` may contain the [optional-query] annotation. This denotes the etor as an info query which is optional for adapters to implement, and may legally result in a non-success error code.
339340
+ `name` must be a unique ISO-C standard identifier, and be all caps
340341
- An etor may take the following optional scalar field: {`value`, `version`}
341342
+ `value` must be an ISO-C standard identifier

scripts/core/PROG.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ points for this are generally of the form:
197197
where ``propName`` selects the information to query out. The object info enum
198198
representing possible queries will generally be found in the enums section of
199199
the relevant object. Some info queries would be difficult or impossible to
200-
support for certain backends, these are denoted with "(optional)" in the enum
201-
description. Using any enum marked optional may result in
200+
support for certain backends, these are denoted with [optional-query] in the
201+
enum description. Using any enum marked optional in this way may result in
202202
${X}_RESULT_ERROR_UNSUPPORTED_ENUMERATION if the adapter doesn't support it.
203203

204204
Programs and Kernels

scripts/generate_code.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,11 @@ def generate_level_zero_queue_api(path, section, namespace, tags, version, specs
549549
meta=meta)
550550
print("QUEUE Generated %s lines of code.\n" % loc)
551551

552+
"""
553+
Entry-point:
554+
generates headers used by the CTS, for example containing meta-information
555+
about info query enums
556+
"""
552557
def generate_cts_headers(path, section, namespace, tags, version, specs, meta):
553558
template = "optional_queries.h.mako"
554559
fin = os.path.join("templates", template)

scripts/templates/helper.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,9 @@ def is_global(item, tags):
542542
return False
543543

544544
"""
545-
Extracts traits from an enum
545+
Extracts traits from an enumerator
546546
"""
547-
class enum_traits:
547+
class etor_traits:
548548
RE_OPTIONAL_QUERY = r".*\[optional-query\].*"
549549

550550
@classmethod
@@ -797,7 +797,6 @@ def etor_get_associated_type(namespace, tags, item):
797797
associated_type = match.group(1)
798798
return subt(namespace, tags, associated_type)
799799
else:
800-
print("couldn't figure type from %s" % item['desc'])
801800
return None
802801

803802
"""
@@ -1719,7 +1718,7 @@ def get_optional_queries(specs, namespace, tags):
17191718
if obj['type'] == 'enum':
17201719
optional_etors = []
17211720
for e in obj['etors']:
1722-
if enum_traits.is_optional_query(e):
1721+
if etor_traits.is_optional_query(e):
17231722
name = make_enum_name(namespace, tags, e)
17241723
optional_etors.append(name)
17251724
if optional_etors:

scripts/templates/optional_queries.h.mako

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import re
33
from templates import helper as th
44
%><%
55
optional_queries = th.get_optional_queries(specs, namespace, tags)
6-
%>
7-
/*
6+
%>/*
87
*
98
* Copyright (C) 2024 Intel Corporation
109
*

test/conformance/adapter/urAdapterGetInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ INSTANTIATE_TEST_SUITE_P(
3535
TEST_P(urAdapterGetInfoTest, Success) {
3636
size_t size = 0;
3737
ur_adapter_info_t info_type = GetParam();
38-
ASSERT_QUERY_SUCCESS(
38+
ASSERT_SUCCES_OR_OPTIONAL_QUERY(
3939
urAdapterGetInfo(adapter, info_type, 0, nullptr, &size), info_type);
4040
ASSERT_NE(size, 0);
4141

test/conformance/context/urContextGetInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ UUR_TEST_SUITE_P(urContextGetInfoTestWithInfoParam,
4343
TEST_P(urContextGetInfoTestWithInfoParam, Success) {
4444
ur_context_info_t info = getParam();
4545
size_t info_size = 0;
46-
ASSERT_QUERY_SUCCESS(
46+
ASSERT_SUCCES_OR_OPTIONAL_QUERY(
4747
urContextGetInfo(context, info, 0, nullptr, &info_size), info);
4848
ASSERT_NE(info_size, 0);
4949

test/conformance/device/urDeviceGetInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ TEST_P(urDeviceGetInfoTest, Success) {
274274
ur_device_info_t info_type = GetParam();
275275
for (auto device : devices) {
276276
size_t size = 0;
277-
ASSERT_QUERY_SUCCESS(
277+
ASSERT_SUCCES_OR_OPTIONAL_QUERY(
278278
urDeviceGetInfo(device, info_type, 0, nullptr, &size), info_type);
279279

280280
if (doesReturnArray(info_type) && size == 0) {

test/conformance/event/urEventGetInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ TEST_P(urEventGetInfoTest, Success) {
1111

1212
ur_event_info_t info_type = getParam();
1313
size_t size;
14-
ASSERT_QUERY_SUCCESS(urEventGetInfo(event, info_type, 0, nullptr, &size),
15-
info_type);
14+
ASSERT_SUCCES_OR_OPTIONAL_QUERY(
15+
urEventGetInfo(event, info_type, 0, nullptr, &size), info_type);
1616
ASSERT_NE(size, 0);
1717
std::vector<uint8_t> data(size);
1818
ASSERT_SUCCESS(

test/conformance/event/urEventGetProfilingInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ TEST_P(urEventGetProfilingInfoTest, Success) {
1212

1313
ur_profiling_info_t info_type = getParam();
1414
size_t size;
15-
ASSERT_QUERY_SUCCESS(
15+
ASSERT_SUCCES_OR_OPTIONAL_QUERY(
1616
urEventGetProfilingInfo(event, info_type, 0, nullptr, &size),
1717
info_type);
1818
ASSERT_EQ(size, 8);

0 commit comments

Comments
 (0)