Skip to content

Commit 56f53be

Browse files
committed
Stop reporting support for experimental features with extension strings.
1 parent d6d9340 commit 56f53be

File tree

25 files changed

+264
-247
lines changed

25 files changed

+264
-247
lines changed

include/ur_api.h

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,6 +1702,13 @@ typedef enum ur_device_info_t {
17021702
///< backed 2D sampled image data.
17031703
UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP = 0x2020, ///< [::ur_bool_t] returns true if the device supports enqueueing of native
17041704
///< work
1705+
UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP = 0x3000, ///< [::ur_bool_t] Returns true if the device supports the use of kernel
1706+
///< launch properties.
1707+
UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP = 0x4000, ///< [::ur_bool_t] Returns true if the device supports the USM P2P
1708+
///< experimental feature.
1709+
UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP = 0x5000, ///< [::ur_bool_t] Returns true if the device supports cooperative kernels.
1710+
UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP = 0x7000, ///< [::ur_bool_t] Returns true if the device supports the multi device
1711+
///< compile experimental feature.
17051712
/// @cond
17061713
UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff
17071714
/// @endcond
@@ -1727,7 +1734,7 @@ typedef enum ur_device_info_t {
17271734
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
17281735
/// + `NULL == hDevice`
17291736
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
1730-
/// + `::UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP < propName`
1737+
/// + `::UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP < propName`
17311738
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
17321739
/// + If `propName` is not supported by the adapter.
17331740
/// - ::UR_RESULT_ERROR_INVALID_SIZE
@@ -8282,13 +8289,6 @@ typedef enum ur_exp_command_buffer_command_info_t {
82828289

82838290
} ur_exp_command_buffer_command_info_t;
82848291

8285-
///////////////////////////////////////////////////////////////////////////////
8286-
#ifndef UR_COMMAND_BUFFER_EXTENSION_STRING_EXP
8287-
/// @brief The extension string which defines support for command-buffers which
8288-
/// is returned when querying device extensions.
8289-
#define UR_COMMAND_BUFFER_EXTENSION_STRING_EXP "ur_exp_command_buffer"
8290-
#endif // UR_COMMAND_BUFFER_EXTENSION_STRING_EXP
8291-
82928292
///////////////////////////////////////////////////////////////////////////////
82938293
/// @brief Command-Buffer Descriptor Type
82948294
typedef struct ur_exp_command_buffer_desc_t {
@@ -9383,13 +9383,6 @@ urCommandBufferCommandGetInfoExp(
93839383
#if !defined(__GNUC__)
93849384
#pragma region cooperative_kernels_(experimental)
93859385
#endif
9386-
///////////////////////////////////////////////////////////////////////////////
9387-
#ifndef UR_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP
9388-
/// @brief The extension string which defines support for cooperative-kernels
9389-
/// which is returned when querying device extensions.
9390-
#define UR_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP "ur_exp_cooperative_kernels"
9391-
#endif // UR_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP
9392-
93939386
///////////////////////////////////////////////////////////////////////////////
93949387
/// @brief Enqueue a command to execute a cooperative kernel
93959388
///
@@ -9513,13 +9506,6 @@ urEnqueueTimestampRecordingExp(
95139506
#if !defined(__GNUC__)
95149507
#pragma region launch_properties_(experimental)
95159508
#endif
9516-
///////////////////////////////////////////////////////////////////////////////
9517-
#ifndef UR_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP
9518-
/// @brief The extension string that defines support for the Launch Properties
9519-
/// extension, which is returned when querying device extensions.
9520-
#define UR_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP "ur_exp_launch_properties"
9521-
#endif // UR_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP
9522-
95239509
///////////////////////////////////////////////////////////////////////////////
95249510
/// @brief Specifies a launch property id
95259511
///
@@ -9642,13 +9628,6 @@ urEnqueueKernelLaunchCustomExp(
96429628
#if !defined(__GNUC__)
96439629
#pragma region multi_device_compile_(experimental)
96449630
#endif
9645-
///////////////////////////////////////////////////////////////////////////////
9646-
#ifndef UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP
9647-
/// @brief The extension string which defines support for test
9648-
/// which is returned when querying device extensions.
9649-
#define UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP "ur_exp_multi_device_compile"
9650-
#endif // UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP
9651-
96529631
///////////////////////////////////////////////////////////////////////////////
96539632
/// @brief Produces an executable program from one program, negates need for the
96549633
/// linking step.
@@ -9825,13 +9804,6 @@ urUSMReleaseExp(
98259804
#if !defined(__GNUC__)
98269805
#pragma region usm_p2p_(experimental)
98279806
#endif
9828-
///////////////////////////////////////////////////////////////////////////////
9829-
#ifndef UR_USM_P2P_EXTENSION_STRING_EXP
9830-
/// @brief The extension string that defines support for USM P2P which is
9831-
/// returned when querying device extensions.
9832-
#define UR_USM_P2P_EXTENSION_STRING_EXP "ur_exp_usm_p2p"
9833-
#endif // UR_USM_P2P_EXTENSION_STRING_EXP
9834-
98359807
///////////////////////////////////////////////////////////////////////////////
98369808
/// @brief Supported peer info
98379809
typedef enum ur_exp_peer_info_t {

include/ur_print.hpp

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,6 +2646,18 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
26462646
case UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP:
26472647
os << "UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP";
26482648
break;
2649+
case UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP:
2650+
os << "UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP";
2651+
break;
2652+
case UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP:
2653+
os << "UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP";
2654+
break;
2655+
case UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP:
2656+
os << "UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP";
2657+
break;
2658+
case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP:
2659+
os << "UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP";
2660+
break;
26492661
default:
26502662
os << "unknown enumerator";
26512663
break;
@@ -4440,6 +4452,54 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info
44404452

44414453
os << ")";
44424454
} break;
4455+
case UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP: {
4456+
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
4457+
if (sizeof(ur_bool_t) > size) {
4458+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")";
4459+
return UR_RESULT_ERROR_INVALID_SIZE;
4460+
}
4461+
os << (const void *)(tptr) << " (";
4462+
4463+
os << *tptr;
4464+
4465+
os << ")";
4466+
} break;
4467+
case UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP: {
4468+
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
4469+
if (sizeof(ur_bool_t) > size) {
4470+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")";
4471+
return UR_RESULT_ERROR_INVALID_SIZE;
4472+
}
4473+
os << (const void *)(tptr) << " (";
4474+
4475+
os << *tptr;
4476+
4477+
os << ")";
4478+
} break;
4479+
case UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP: {
4480+
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
4481+
if (sizeof(ur_bool_t) > size) {
4482+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")";
4483+
return UR_RESULT_ERROR_INVALID_SIZE;
4484+
}
4485+
os << (const void *)(tptr) << " (";
4486+
4487+
os << *tptr;
4488+
4489+
os << ")";
4490+
} break;
4491+
case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP: {
4492+
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
4493+
if (sizeof(ur_bool_t) > size) {
4494+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")";
4495+
return UR_RESULT_ERROR_INVALID_SIZE;
4496+
}
4497+
os << (const void *)(tptr) << " (";
4498+
4499+
os << *tptr;
4500+
4501+
os << ")";
4502+
} break;
44434503
default:
44444504
os << "unknown enumerator";
44454505
return UR_RESULT_ERROR_INVALID_ENUMERATION;

scripts/core/EXP-COMMAND-BUFFER.rst

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,14 @@ Querying Command-Buffer Support
4040
--------------------------------------------------------------------------------
4141

4242
Support for command-buffers can be queried for a given device/adapter by using
43-
the device info query with ${X}_DEVICE_INFO_EXTENSIONS. Adapters supporting this
44-
experimental feature will report the string "ur_exp_command_buffer" in the
45-
returned list of supported extensions.
46-
47-
.. hint::
48-
The macro ${X}_COMMAND_BUFFER_EXTENSION_STRING_EXP is defined for the string
49-
returned from extension queries for this feature. Since the actual string
50-
may be subject to change it is safer to use this macro when querying for
51-
support for this experimental feature.
43+
the device info query with ${X}_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP. Adapters
44+
supporting this experimental feature will report ``true``.
5245

5346
.. parsed-literal::
5447
55-
// Retrieve length of extension string
56-
size_t returnedSize;
57-
${x}DeviceGetInfo(hDevice, ${X}_DEVICE_INFO_EXTENSIONS, 0, nullptr,
58-
&returnedSize);
59-
60-
// Retrieve extension string
61-
std::unique_ptr<char[]> returnedExtensions(new char[returnedSize]);
62-
${x}DeviceGetInfo(hDevice, ${X}_DEVICE_INFO_EXTENSIONS, returnedSize,
63-
returnedExtensions.get(), nullptr);
64-
65-
std::string_view ExtensionsString(returnedExtensions.get());
66-
bool CmdBufferSupport =
67-
ExtensionsString.find(${X}_COMMAND_BUFFER_EXTENSION_STRING_EXP)
68-
!= std::string::npos;
69-
70-
.. note::
71-
The ${X}_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP device info query exists to
72-
serve the same purpose as ${X}_COMMAND_BUFFER_EXTENSION_STRING_EXP.
48+
ur_bool_t CmdBufferSupport = false;
49+
${x}DeviceGetInfo(hDevice, ${X}_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP,
50+
sizeof(CmdBufferSupport), &CmdBufferSupport, nullptr);
7351
7452
Command-Buffer Creation
7553
--------------------------------------------------------------------------------
@@ -396,10 +374,6 @@ ${x}CommandBufferUpdateSignalEventExp there must also have been a non-null
396374
API
397375
--------------------------------------------------------------------------------
398376

399-
Macros
400-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
401-
* ${X}_COMMAND_BUFFER_EXTENSION_STRING_EXP
402-
403377
Enums
404378
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
405379
* ${x}_device_info_t
@@ -510,6 +484,9 @@ Changelog
510484
+-----------+-------------------------------------------------------+
511485
| 1.6 | Command level synchronization with event objects |
512486
+-----------+-------------------------------------------------------+
487+
| 1.7 | Remove extension string macro, make device info enum |
488+
| | primary mechanism for reporting support. |
489+
+-----------+-------------------------------------------------------+
513490

514491
Contributors
515492
--------------------------------------------------------------------------------

scripts/core/EXP-COOPERATIVE-KERNELS.rst

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ The functions defined here align with those specified in Level Zero.
3636
API
3737
--------------------------------------------------------------------------------
3838

39-
Macros
39+
Enums
4040
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41-
* ${X}_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP
41+
* ${x}_device_info_t
42+
* ${X}_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP
4243

4344
Functions
4445
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -47,22 +48,25 @@ Functions
4748

4849
Changelog
4950
--------------------------------------------------------------------------------
50-
+-----------+------------------------+
51-
| Revision | Changes |
52-
+===========+========================+
53-
| 1.0 | Initial Draft |
54-
+-----------+------------------------+
51+
+-----------+---------------------------------------------+
52+
| Revision | Changes |
53+
+===========+=============================================+
54+
| 1.0 | Initial Draft |
55+
+-----------+---------------------------------------------+
56+
| 1.1 | Switch from extension string macro to |
57+
| | device info enum for reporting support. |
58+
+-----------+---------------------------------------------+
5559

5660
Support
5761
--------------------------------------------------------------------------------
5862

59-
Adapters which support this experimental feature *must* return the valid string
60-
defined in ``${X}_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP``
61-
as one of the options from ${x}DeviceGetInfo when querying for
62-
${X}_DEVICE_INFO_EXTENSIONS. Conversely, before using any of the
63-
functionality defined in this experimental feature the user *must* use the
64-
device query to determine if the adapter supports this feature.
63+
Adapters which support this experimental feature *must* return ``true`` when
64+
queried for ${X}_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP via
65+
${x}DeviceGetInfo. Conversely, before using any of the functionality defined in
66+
this experimental feature the user *must* use the device query to determine if
67+
the adapter supports this feature.
6568

6669
Contributors
6770
--------------------------------------------------------------------------------
6871
72+

scripts/core/EXP-LAUNCH-PROPERTIES.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,12 @@ cooperative kernels Unified-Runtime extension.
5555
API
5656
--------------------------------------------------------------------------------
5757

58-
Macros
59-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60-
61-
* ${X}_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP
62-
6358
Enums
6459
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6560

61+
* ${x}_device_info_t
62+
* ${X}_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP
63+
6664
* ${x}_exp_launch_property_id_t
6765

6866
Unions
@@ -83,9 +81,12 @@ Functions
8381
Support
8482
--------------------------------------------------------------------------------
8583

86-
Adapters which support this experimental feature *must* return the valid string
87-
defined in ${X}_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP as one of the options from
88-
${x}DeviceGetInfo when querying for ${X}_DEVICE_INFO_EXTENSIONS.
84+
Adapters which support this experimental feature *must* return ``true`` when
85+
queried for ${X}_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP via
86+
${x}DeviceGetInfo. Conversely, before using any of the functionality defined
87+
in this experimental feature the user *must* use the device query to determine
88+
if the adapter supports this feature.
89+
8990

9091
Changelog
9192
--------------------------------------------------------------------------------
@@ -95,8 +96,12 @@ Changelog
9596
+===========+=============================================+
9697
| 1.0 | Initial Draft |
9798
+-----------+---------------------------------------------+
99+
| 1.1 | Switch from extension string macro to |
100+
| | device info enum for reporting support. |
101+
+-----------+---------------------------------------------+
98102

99103
Contributors
100104
--------------------------------------------------------------------------------
101105

102106
107+

scripts/core/EXP-MULTI-DEVICE-COMPILE.rst

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ future.
3232
API
3333
--------------------------------------------------------------------------------
3434

35+
Enums
36+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37+
* ${x}_device_info_t
38+
* ${X}_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP
39+
3540
Functions
3641
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3742

@@ -42,23 +47,26 @@ Functions
4247
Changelog
4348
--------------------------------------------------------------------------------
4449

45-
+-----------+------------------------+
46-
| Revision | Changes |
47-
+===========+========================+
48-
| 1.0 | Initial Draft |
49-
+-----------+------------------------+
50+
+-----------+---------------------------------------------+
51+
| Revision | Changes |
52+
+===========+=============================================+
53+
| 1.0 | Initial Draft |
54+
+-----------+---------------------------------------------+
55+
| 1.1 | Switch from extension string macro to |
56+
| | device info enum for reporting support. |
57+
+-----------+---------------------------------------------+
5058

5159
Support
5260
--------------------------------------------------------------------------------
5361

54-
Adapters which support this experimental feature *must* return the valid string
55-
defined in ``${X}_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP``
56-
as one of the options from ${x}DeviceGetInfo when querying for
57-
${X}_DEVICE_INFO_EXTENSIONS. Conversely, before using any of the
58-
functionality defined in this experimental feature the user *must* use the
59-
device query to determine if the adapter supports this feature.
62+
Adapters which support this experimental feature *must* return ``true`` when
63+
queried for ${X}_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP via
64+
${x}DeviceGetInfo. Conversely, before using any of the functionality defined
65+
in this experimental feature the user *must* use the device query to determine
66+
if the adapter supports this feature.
6067

6168
Contributors
6269
--------------------------------------------------------------------------------
6370

6471
* Kenneth Benzie (Benie) `[email protected] <[email protected]>`_
72+

0 commit comments

Comments
 (0)