From cae3d552262363bcd8856f78fac7159c292a3e48 Mon Sep 17 00:00:00 2001 From: Aaron Greig Date: Mon, 11 Nov 2024 16:35:43 +0000 Subject: [PATCH 1/2] Stop reporting support for experimental features with extension strings. --- include/ur_api.h | 49 ++++---------- include/ur_print.hpp | 64 +++++++++++++++++++ scripts/core/EXP-COMMAND-BUFFER.rst | 39 +++-------- scripts/core/EXP-COOPERATIVE-KERNELS.rst | 30 +++++---- scripts/core/EXP-LAUNCH-PROPERTIES.rst | 21 +++--- scripts/core/EXP-MULTI-DEVICE-COMPILE.rst | 30 +++++---- scripts/core/EXP-USM-P2P.rst | 19 ++++-- scripts/core/exp-command-buffer.yml | 5 -- scripts/core/exp-cooperative-kernels.yml | 15 +++-- scripts/core/exp-launch-properties.yml | 13 ++-- scripts/core/exp-multi-device-compile.yml | 15 +++-- scripts/core/exp-usm-p2p.yml | 13 ++-- source/adapters/cuda/device.cpp | 16 +++-- source/adapters/hip/device.cpp | 40 +++++------- source/adapters/level_zero/device.cpp | 14 ++-- source/adapters/native_cpu/device.cpp | 12 ++++ source/adapters/opencl/device.cpp | 27 +++----- source/loader/layers/validation/ur_valddi.cpp | 2 +- source/loader/ur_libapi.cpp | 2 +- source/ur_api.cpp | 2 +- .../urEnqueueKernelLaunchAndMemcpyInOrder.cpp | 17 +---- .../conformance/exp_command_buffer/fixtures.h | 18 ++---- .../launch_properties.cpp | 20 ++---- test/conformance/exp_usm_p2p/usm_p2p.cpp | 18 ++---- tools/urinfo/urinfo.hpp | 11 ++++ 25 files changed, 267 insertions(+), 245 deletions(-) diff --git a/include/ur_api.h b/include/ur_api.h index 3b3e05348c..716a72ab91 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -2297,6 +2297,17 @@ typedef enum ur_device_info_t { /// [::ur_exp_device_2d_block_array_capability_flags_t] return a bit-field /// of Intel GPU 2D block array capabilities UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP = 0x2022, + /// [::ur_bool_t] Returns true if the device supports the use of kernel + /// launch properties. + UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP = 0x3000, + /// [::ur_bool_t] Returns true if the device supports the USM P2P + /// experimental feature. + UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP = 0x4000, + /// [::ur_bool_t] Returns true if the device supports cooperative kernels. + UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP = 0x5000, + /// [::ur_bool_t] Returns true if the device supports the multi device + /// compile experimental feature. + UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP = 0x7000, /// @cond UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -2322,7 +2333,7 @@ typedef enum ur_device_info_t { /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP < propName` +/// + `::UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE @@ -9930,13 +9941,6 @@ typedef enum ur_exp_command_buffer_command_info_t { } ur_exp_command_buffer_command_info_t; -/////////////////////////////////////////////////////////////////////////////// -#ifndef UR_COMMAND_BUFFER_EXTENSION_STRING_EXP -/// @brief The extension string which defines support for command-buffers which -/// is returned when querying device extensions. -#define UR_COMMAND_BUFFER_EXTENSION_STRING_EXP "ur_exp_command_buffer" -#endif // UR_COMMAND_BUFFER_EXTENSION_STRING_EXP - /////////////////////////////////////////////////////////////////////////////// /// @brief Command-Buffer Descriptor Type typedef struct ur_exp_command_buffer_desc_t { @@ -11290,13 +11294,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCommandGetInfoExp( #if !defined(__GNUC__) #pragma region cooperative_kernels_(experimental) #endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef UR_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP -/// @brief The extension string which defines support for cooperative-kernels -/// which is returned when querying device extensions. -#define UR_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP "ur_exp_cooperative_kernels" -#endif // UR_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP - /////////////////////////////////////////////////////////////////////////////// /// @brief Enqueue a command to execute a cooperative kernel /// @@ -11445,13 +11442,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( #if !defined(__GNUC__) #pragma region launch_properties_(experimental) #endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef UR_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP -/// @brief The extension string that defines support for the Launch Properties -/// extension, which is returned when querying device extensions. -#define UR_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP "ur_exp_launch_properties" -#endif // UR_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP - /////////////////////////////////////////////////////////////////////////////// /// @brief Specifies a launch property id /// @@ -11598,14 +11588,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( #if !defined(__GNUC__) #pragma region multi_device_compile_(experimental) #endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP -/// @brief The extension string which defines support for test -/// which is returned when querying device extensions. -#define UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP \ - "ur_exp_multi_device_compile" -#endif // UR_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP - /////////////////////////////////////////////////////////////////////////////// /// @brief Produces an executable program from one program, negates need for the /// linking step. @@ -11793,13 +11775,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMReleaseExp( #if !defined(__GNUC__) #pragma region usm_p2p_(experimental) #endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef UR_USM_P2P_EXTENSION_STRING_EXP -/// @brief The extension string that defines support for USM P2P which is -/// returned when querying device extensions. -#define UR_USM_P2P_EXTENSION_STRING_EXP "ur_exp_usm_p2p" -#endif // UR_USM_P2P_EXTENSION_STRING_EXP - /////////////////////////////////////////////////////////////////////////////// /// @brief Supported peer info typedef enum ur_exp_peer_info_t { diff --git a/include/ur_print.hpp b/include/ur_print.hpp index 2e6f7d715d..1420c06b19 100644 --- a/include/ur_print.hpp +++ b/include/ur_print.hpp @@ -3019,6 +3019,18 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) { case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP: os << "UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP"; break; + case UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP: + os << "UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP"; + break; + case UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP: + os << "UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP"; + break; + case UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP: + os << "UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP"; + break; + case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP: + os << "UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP"; + break; default: os << "unknown enumerator"; break; @@ -4997,6 +5009,58 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, os << ")"; } break; + case UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP: { + const ur_bool_t *tptr = (const ur_bool_t *)ptr; + if (sizeof(ur_bool_t) > size) { + os << "invalid size (is: " << size + << ", expected: >=" << sizeof(ur_bool_t) << ")"; + return UR_RESULT_ERROR_INVALID_SIZE; + } + os << (const void *)(tptr) << " ("; + + os << *tptr; + + os << ")"; + } break; + case UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP: { + const ur_bool_t *tptr = (const ur_bool_t *)ptr; + if (sizeof(ur_bool_t) > size) { + os << "invalid size (is: " << size + << ", expected: >=" << sizeof(ur_bool_t) << ")"; + return UR_RESULT_ERROR_INVALID_SIZE; + } + os << (const void *)(tptr) << " ("; + + os << *tptr; + + os << ")"; + } break; + case UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP: { + const ur_bool_t *tptr = (const ur_bool_t *)ptr; + if (sizeof(ur_bool_t) > size) { + os << "invalid size (is: " << size + << ", expected: >=" << sizeof(ur_bool_t) << ")"; + return UR_RESULT_ERROR_INVALID_SIZE; + } + os << (const void *)(tptr) << " ("; + + os << *tptr; + + os << ")"; + } break; + case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP: { + const ur_bool_t *tptr = (const ur_bool_t *)ptr; + if (sizeof(ur_bool_t) > size) { + os << "invalid size (is: " << size + << ", expected: >=" << sizeof(ur_bool_t) << ")"; + return UR_RESULT_ERROR_INVALID_SIZE; + } + os << (const void *)(tptr) << " ("; + + os << *tptr; + + os << ")"; + } break; default: os << "unknown enumerator"; return UR_RESULT_ERROR_INVALID_ENUMERATION; diff --git a/scripts/core/EXP-COMMAND-BUFFER.rst b/scripts/core/EXP-COMMAND-BUFFER.rst index 2313afd036..c9cbbf1281 100644 --- a/scripts/core/EXP-COMMAND-BUFFER.rst +++ b/scripts/core/EXP-COMMAND-BUFFER.rst @@ -40,36 +40,14 @@ Querying Command-Buffer Support -------------------------------------------------------------------------------- Support for command-buffers can be queried for a given device/adapter by using -the device info query with ${X}_DEVICE_INFO_EXTENSIONS. Adapters supporting this -experimental feature will report the string "ur_exp_command_buffer" in the -returned list of supported extensions. - -.. hint:: - The macro ${X}_COMMAND_BUFFER_EXTENSION_STRING_EXP is defined for the string - returned from extension queries for this feature. Since the actual string - may be subject to change it is safer to use this macro when querying for - support for this experimental feature. +the device info query with ${X}_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP. Adapters +supporting this experimental feature will report ``true``. .. parsed-literal:: - // Retrieve length of extension string - size_t returnedSize; - ${x}DeviceGetInfo(hDevice, ${X}_DEVICE_INFO_EXTENSIONS, 0, nullptr, - &returnedSize); - - // Retrieve extension string - std::unique_ptr returnedExtensions(new char[returnedSize]); - ${x}DeviceGetInfo(hDevice, ${X}_DEVICE_INFO_EXTENSIONS, returnedSize, - returnedExtensions.get(), nullptr); - - std::string_view ExtensionsString(returnedExtensions.get()); - bool CmdBufferSupport = - ExtensionsString.find(${X}_COMMAND_BUFFER_EXTENSION_STRING_EXP) - != std::string::npos; - -.. note:: - The ${X}_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP device info query exists to - serve the same purpose as ${X}_COMMAND_BUFFER_EXTENSION_STRING_EXP. + ur_bool_t CmdBufferSupport = false; + ${x}DeviceGetInfo(hDevice, ${X}_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP, + sizeof(CmdBufferSupport), &CmdBufferSupport, nullptr); Command-Buffer Creation -------------------------------------------------------------------------------- @@ -401,10 +379,6 @@ ${x}CommandBufferUpdateSignalEventExp there must also have been a non-null API -------------------------------------------------------------------------------- -Macros -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* ${X}_COMMAND_BUFFER_EXTENSION_STRING_EXP - Enums ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * ${x}_device_info_t @@ -515,6 +489,9 @@ Changelog +-----------+-------------------------------------------------------+ | 1.6 | Command level synchronization with event objects | +-----------+-------------------------------------------------------+ +| 1.7 | Remove extension string macro, make device info enum | +| | primary mechanism for reporting support. | ++-----------+-------------------------------------------------------+ Contributors -------------------------------------------------------------------------------- diff --git a/scripts/core/EXP-COOPERATIVE-KERNELS.rst b/scripts/core/EXP-COOPERATIVE-KERNELS.rst index c6b64ef669..ba055c48ff 100644 --- a/scripts/core/EXP-COOPERATIVE-KERNELS.rst +++ b/scripts/core/EXP-COOPERATIVE-KERNELS.rst @@ -36,9 +36,10 @@ The functions defined here align with those specified in Level Zero. API -------------------------------------------------------------------------------- -Macros +Enums ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* ${X}_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP +* ${x}_device_info_t + * ${X}_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP Functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -47,22 +48,25 @@ Functions Changelog -------------------------------------------------------------------------------- -+-----------+------------------------+ -| Revision | Changes | -+===========+========================+ -| 1.0 | Initial Draft | -+-----------+------------------------+ ++-----------+---------------------------------------------+ +| Revision | Changes | ++===========+=============================================+ +| 1.0 | Initial Draft | ++-----------+---------------------------------------------+ +| 1.1 | Switch from extension string macro to | +| | device info enum for reporting support. | ++-----------+---------------------------------------------+ Support -------------------------------------------------------------------------------- -Adapters which support this experimental feature *must* return the valid string -defined in ``${X}_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP`` -as one of the options from ${x}DeviceGetInfo when querying for -${X}_DEVICE_INFO_EXTENSIONS. Conversely, before using any of the -functionality defined in this experimental feature the user *must* use the -device query to determine if the adapter supports this feature. +Adapters which support this experimental feature *must* return ``true`` when +queried for ${X}_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP via +${x}DeviceGetInfo. Conversely, before using any of the functionality defined in +this experimental feature the user *must* use the device query to determine if +the adapter supports this feature. Contributors -------------------------------------------------------------------------------- * Michael Aziz `michael.aziz@intel.com `_ +* Aaron Greig `aaron.greig@codeplay.com `_ diff --git a/scripts/core/EXP-LAUNCH-PROPERTIES.rst b/scripts/core/EXP-LAUNCH-PROPERTIES.rst index a0a116b293..81703aaca5 100644 --- a/scripts/core/EXP-LAUNCH-PROPERTIES.rst +++ b/scripts/core/EXP-LAUNCH-PROPERTIES.rst @@ -55,14 +55,12 @@ cooperative kernels Unified-Runtime extension. API -------------------------------------------------------------------------------- -Macros -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -* ${X}_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP - Enums ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* ${x}_device_info_t + * ${X}_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP + * ${x}_exp_launch_property_id_t Unions @@ -83,9 +81,12 @@ Functions Support -------------------------------------------------------------------------------- -Adapters which support this experimental feature *must* return the valid string -defined in ${X}_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP as one of the options from -${x}DeviceGetInfo when querying for ${X}_DEVICE_INFO_EXTENSIONS. +Adapters which support this experimental feature *must* return ``true`` when +queried for ${X}_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP via +${x}DeviceGetInfo. Conversely, before using any of the functionality defined +in this experimental feature the user *must* use the device query to determine +if the adapter supports this feature. + Changelog -------------------------------------------------------------------------------- @@ -95,8 +96,12 @@ Changelog +===========+=============================================+ | 1.0 | Initial Draft | +-----------+---------------------------------------------+ +| 1.1 | Switch from extension string macro to | +| | device info enum for reporting support. | ++-----------+---------------------------------------------+ Contributors -------------------------------------------------------------------------------- * JackAKirk `jack.kirk@codeplay.com `_ +* Aaron Greig `aaron.greig@codeplay.com `_ diff --git a/scripts/core/EXP-MULTI-DEVICE-COMPILE.rst b/scripts/core/EXP-MULTI-DEVICE-COMPILE.rst index d4c2a6cb7a..19dc26268b 100644 --- a/scripts/core/EXP-MULTI-DEVICE-COMPILE.rst +++ b/scripts/core/EXP-MULTI-DEVICE-COMPILE.rst @@ -32,6 +32,11 @@ future. API -------------------------------------------------------------------------------- +Enums +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* ${x}_device_info_t + * ${X}_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP + Functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -42,23 +47,26 @@ Functions Changelog -------------------------------------------------------------------------------- -+-----------+------------------------+ -| Revision | Changes | -+===========+========================+ -| 1.0 | Initial Draft | -+-----------+------------------------+ ++-----------+---------------------------------------------+ +| Revision | Changes | ++===========+=============================================+ +| 1.0 | Initial Draft | ++-----------+---------------------------------------------+ +| 1.1 | Switch from extension string macro to | +| | device info enum for reporting support. | ++-----------+---------------------------------------------+ Support -------------------------------------------------------------------------------- -Adapters which support this experimental feature *must* return the valid string -defined in ``${X}_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP`` -as one of the options from ${x}DeviceGetInfo when querying for -${X}_DEVICE_INFO_EXTENSIONS. Conversely, before using any of the -functionality defined in this experimental feature the user *must* use the -device query to determine if the adapter supports this feature. +Adapters which support this experimental feature *must* return ``true`` when +queried for ${X}_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP via +${x}DeviceGetInfo. Conversely, before using any of the functionality defined +in this experimental feature the user *must* use the device query to determine +if the adapter supports this feature. Contributors -------------------------------------------------------------------------------- * Kenneth Benzie (Benie) `k.benzie@codeplay.com `_ +* Aaron Greig `aaron.greig@codeplay.com `_ diff --git a/scripts/core/EXP-USM-P2P.rst b/scripts/core/EXP-USM-P2P.rst index aa6c12ecb4..c074de4368 100644 --- a/scripts/core/EXP-USM-P2P.rst +++ b/scripts/core/EXP-USM-P2P.rst @@ -37,13 +37,12 @@ Level Zero. API -------------------------------------------------------------------------------- -Macros -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* ${X}_USM_P2P_EXTENSION_STRING_EXP - Enums ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* ${x}_device_info_t + * ${X}_DEVICE_INFO_USM_P2P_SUPPORT_EXP + * ${x}_exp_peer_info_t Functions @@ -55,9 +54,11 @@ Functions Support -------------------------------------------------------------------------------- -Adapters which support this experimental feature *must* return the valid string -defined in ``${X}_USM_P2P_EXTENSION_STRING_EXP`` as one of the options from -${x}DeviceGetInfo when querying for ${X}_DEVICE_INFO_EXTENSIONS. +Adapters which support this experimental feature *must* return ``true`` when +queried for ${X}_DEVICE_INFO_USM_P2P_SUPPORT_EXP via ${x}DeviceGetInfo. +Conversely, before using any of the functionality defined in this experimental +feature the user *must* use the device query to determine if the adapter +supports this feature. Changelog -------------------------------------------------------------------------------- @@ -71,8 +72,12 @@ Changelog +-----------+---------------------------------------------+ | 1.2 | Switch Info types from uint32_t to int | +-----------+---------------------------------------------+ +| 1.3 | Switch from extension string macro to | +| | device info enum for reporting support. | ++-----------+---------------------------------------------+ Contributors -------------------------------------------------------------------------------- * JackAKirk `jack.kirk@codeplay.com `_ +* Aaron Greig `aaron.greig@codeplay.com `_ diff --git a/scripts/core/exp-command-buffer.yml b/scripts/core/exp-command-buffer.yml index 6abcb48695..f7fe6319ab 100644 --- a/scripts/core/exp-command-buffer.yml +++ b/scripts/core/exp-command-buffer.yml @@ -130,11 +130,6 @@ 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. --- #-------------------------------------------------------------------------- -type: macro -desc: "The extension string which defines support for command-buffers which is returned when querying device extensions." -name: $X_COMMAND_BUFFER_EXTENSION_STRING_EXP -value: "\"$x_exp_command_buffer\"" ---- #-------------------------------------------------------------------------- type: struct desc: "Command-Buffer Descriptor Type" name: $x_exp_command_buffer_desc_t diff --git a/scripts/core/exp-cooperative-kernels.yml b/scripts/core/exp-cooperative-kernels.yml index 6020ca5f45..4edf2a7065 100644 --- a/scripts/core/exp-cooperative-kernels.yml +++ b/scripts/core/exp-cooperative-kernels.yml @@ -12,12 +12,15 @@ type: header desc: "Intel $OneApi Unified Runtime Experimental APIs for Cooperative Kernels" ordinal: "99" --- #-------------------------------------------------------------------------- -type: macro -desc: | - The extension string which defines support for cooperative-kernels - which is returned when querying device extensions. -name: $X_COOPERATIVE_KERNELS_EXTENSION_STRING_EXP -value: "\"$x_exp_cooperative_kernels\"" +type: enum +extend: true +typed_etors: true +desc: "Extension enums for $x_device_info_t to support cooperative kernels." +name: $x_device_info_t +etors: + - name: COOPERATIVE_KERNEL_SUPPORT_EXP + value: "0x5000" + desc: "[$x_bool_t] Returns true if the device supports cooperative kernels." --- #-------------------------------------------------------------------------- type: function desc: "Enqueue a command to execute a cooperative kernel" diff --git a/scripts/core/exp-launch-properties.yml b/scripts/core/exp-launch-properties.yml index ca28421815..b56c6cd80f 100644 --- a/scripts/core/exp-launch-properties.yml +++ b/scripts/core/exp-launch-properties.yml @@ -12,10 +12,15 @@ type: header desc: "Intel $OneApi Unified Runtime Experimental APIs for (kernel) Launch Properties" ordinal: "99" --- #-------------------------------------------------------------------------- -type: macro -desc: "The extension string that defines support for the Launch Properties extension, which is returned when querying device extensions." -name: $X_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP -value: "\"$x_exp_launch_properties\"" +type: enum +extend: true +typed_etors: true +desc: "Extension enums for $x_device_info_t to support launch properties." +name: $x_device_info_t +etors: + - name: LAUNCH_PROPERTIES_SUPPORT_EXP + value: "0x3000" + desc: "[$x_bool_t] Returns true if the device supports the use of kernel launch properties." --- #-------------------------------------------------------------------------- type: enum desc: "Specifies a launch property id" diff --git a/scripts/core/exp-multi-device-compile.yml b/scripts/core/exp-multi-device-compile.yml index ddd1fcf541..247e2c4087 100644 --- a/scripts/core/exp-multi-device-compile.yml +++ b/scripts/core/exp-multi-device-compile.yml @@ -11,15 +11,18 @@ type: header desc: "Intel $OneApi Unified Runtime Experimental APIs for multi-device compile" ordinal: "99" - --- #-------------------------------------------------------------------------- -type: macro -desc: | - The extension string which defines support for test - which is returned when querying device extensions. name: $X_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP value: "\"$x_exp_multi_device_compile\"" - +type: enum +extend: true +typed_etors: true +desc: "Extension enums for $x_device_info_t to support multi device compile." +name: $x_device_info_t +etors: + - name: MULTI_DEVICE_COMPILE_SUPPORT_EXP + value: "0x7000" + desc: "[$x_bool_t] Returns true if the device supports the multi device compile experimental feature." --- #-------------------------------------------------------------------------- type: function desc: "Produces an executable program from one program, negates need for the linking step." diff --git a/scripts/core/exp-usm-p2p.yml b/scripts/core/exp-usm-p2p.yml index f3ba303c34..5d1b109d5d 100644 --- a/scripts/core/exp-usm-p2p.yml +++ b/scripts/core/exp-usm-p2p.yml @@ -12,10 +12,15 @@ type: header desc: "Intel $OneApi Unified Runtime Experimental APIs for USM P2P" ordinal: "99" --- #-------------------------------------------------------------------------- -type: macro -desc: "The extension string that defines support for USM P2P which is returned when querying device extensions." -name: $X_USM_P2P_EXTENSION_STRING_EXP -value: "\"$x_exp_usm_p2p\"" +type: enum +extend: true +typed_etors: true +desc: "Extension enums for $x_device_info_t to support USM P2P." +name: $x_device_info_t +etors: + - name: USM_P2P_SUPPORT_EXP + value: "0x4000" + desc: "[$x_bool_t] Returns true if the device supports the USM P2P experimental feature." --- #-------------------------------------------------------------------------- type: enum desc: "Supported peer info" diff --git a/source/adapters/cuda/device.cpp b/source/adapters/cuda/device.cpp index bcdfe8f6dd..baff9f8370 100644 --- a/source/adapters/cuda/device.cpp +++ b/source/adapters/cuda/device.cpp @@ -615,13 +615,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, } case UR_DEVICE_INFO_EXTENSIONS: { - std::string SupportedExtensions = "cl_khr_fp64 cl_khr_subgroups "; + std::string SupportedExtensions = "cl_khr_fp64 "; SupportedExtensions += "cl_intel_devicelib_assert "; - // Return supported for the UR command-buffer experimental feature - SupportedExtensions += "ur_exp_command_buffer "; - SupportedExtensions += "ur_exp_usm_p2p "; - SupportedExtensions += "ur_exp_launch_properties "; - SupportedExtensions += " "; int Major = 0; int Minor = 0; @@ -1113,6 +1108,15 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, } case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: return ReturnValue(false); + case UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP: + return ReturnValue(true); + case UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP: + return ReturnValue(true); + case UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP: + return ReturnValue(true); + case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP: + return ReturnValue(false); + default: break; } diff --git a/source/adapters/hip/device.cpp b/source/adapters/hip/device.cpp index 76bfefaa33..7bb0f39fa8 100644 --- a/source/adapters/hip/device.cpp +++ b/source/adapters/hip/device.cpp @@ -562,22 +562,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, // native asserts are in progress std::string SupportedExtensions = ""; SupportedExtensions += "cl_intel_devicelib_assert "; - SupportedExtensions += "ur_exp_usm_p2p "; - - int RuntimeVersion = 0; - UR_CHECK_ERROR(hipRuntimeGetVersion(&RuntimeVersion)); - - // Return supported for the UR command-buffer experimental feature on - // ROCM 5.5.1 and later. This is to workaround HIP driver bug - // https://github.com/ROCm/HIP/issues/2450 in older versions. - // - // The version is returned as (10000000 major + 1000000 minor + patch). - const int CmdBufDriverMinVersion = 50530202; // ROCM 5.5.1 - if (RuntimeVersion >= CmdBufDriverMinVersion) { - SupportedExtensions += "ur_exp_command_buffer "; - } - - SupportedExtensions += " "; hipDeviceProp_t Props; detail::ur::assertion(hipGetDeviceProperties(&Props, hDevice->get()) == @@ -935,22 +919,22 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue( static_cast(0)); case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP: { - int DriverVersion = 0; - UR_CHECK_ERROR(hipDriverGetVersion(&DriverVersion)); + int RuntimeVersion = 0; + UR_CHECK_ERROR(hipRuntimeGetVersion(&RuntimeVersion)); // Return supported for the UR command-buffer experimental feature on // ROCM 5.5.1 and later. This is to workaround HIP driver bug // https://github.com/ROCm/HIP/issues/2450 in older versions. // // The version is returned as (10000000 major + 1000000 minor + patch). - const int CmdBufDriverMinVersion = 50530202; // ROCM 5.5.1 - return ReturnValue(DriverVersion >= CmdBufDriverMinVersion); + const int CmdBufRuntimeMinVersion = 50530202; // ROCM 5.5.1 + return ReturnValue(RuntimeVersion >= CmdBufRuntimeMinVersion); } case UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_CAPABILITIES_EXP: { - int DriverVersion = 0; - UR_CHECK_ERROR(hipDriverGetVersion(&DriverVersion)); - const int CmdBufDriverMinVersion = 50530202; // ROCM 5.5.1 - if (DriverVersion < CmdBufDriverMinVersion) { + int RuntimeVersion = 0; + UR_CHECK_ERROR(hipRuntimeGetVersion(&RuntimeVersion)); + const int CmdBufRuntimeMinVersion = 50530202; // ROCM 5.5.1 + if (RuntimeVersion < CmdBufRuntimeMinVersion) { return ReturnValue( static_cast(0)); } @@ -967,6 +951,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: { return ReturnValue(false); } + case UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP: + return ReturnValue(true); + case UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP: + return ReturnValue(true); + case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP: + return ReturnValue(false); default: break; } diff --git a/source/adapters/level_zero/device.cpp b/source/adapters/level_zero/device.cpp index 6b21507d8e..66ee231645 100644 --- a/source/adapters/level_zero/device.cpp +++ b/source/adapters/level_zero/device.cpp @@ -291,12 +291,6 @@ ur_result_t urDeviceGetInfo( (Device->ZeDeviceProperties->deviceId & 0xff0) == 0xbd0) SupportedExtensions += ("cl_intel_bfloat16_conversions "); - // Return supported for the UR command-buffer experimental feature - SupportedExtensions += ("ur_exp_command_buffer "); - // Return supported for the UR multi-device compile experimental feature - SupportedExtensions += ("ur_exp_multi_device_compile "); - SupportedExtensions += ("ur_exp_usm_p2p "); - return ReturnValue(SupportedExtensions.c_str()); } case UR_DEVICE_INFO_NAME: @@ -1192,6 +1186,14 @@ ur_result_t urDeviceGetInfo( return ReturnValue(false); case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED: return ReturnValue(false); + case UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP: + return ReturnValue(true); + case UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP: + return ReturnValue(true); + case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP: + return ReturnValue(true); default: logger::error("Unsupported ParamName in urGetDeviceInfo"); logger::error("ParamNameParamName={}(0x{})", ParamName, diff --git a/source/adapters/native_cpu/device.cpp b/source/adapters/native_cpu/device.cpp index 6f3234ab0b..a26cc98861 100644 --- a/source/adapters/native_cpu/device.cpp +++ b/source/adapters/native_cpu/device.cpp @@ -433,6 +433,18 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS: return ReturnValue(false); + case UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP: + return ReturnValue(false); + + case UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP: + return ReturnValue(false); + + case UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP: + return ReturnValue(false); + + case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP: + return ReturnValue(true); + default: DIE_NO_IMPLEMENTATION; } diff --git a/source/adapters/opencl/device.cpp b/source/adapters/opencl/device.cpp index 4ed3eeb3b0..0ccc6cd1a4 100644 --- a/source/adapters/opencl/device.cpp +++ b/source/adapters/opencl/device.cpp @@ -983,7 +983,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_VERSION: case UR_EXT_DEVICE_INFO_OPENCL_C_VERSION: case UR_DEVICE_INFO_BUILT_IN_KERNELS: - case UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES: { + case UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES: + case UR_DEVICE_INFO_EXTENSIONS: { /* We can just use the OpenCL outputs because the sizes of OpenCL types * are the same as UR. * | CL | UR | Size | @@ -1092,22 +1093,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue.template operator()(SubGroupSizes.data(), SubGroupSizes.size()); } - case UR_DEVICE_INFO_EXTENSIONS: { - cl_device_id Dev = cl_adapter::cast(hDevice); - size_t ExtSize = 0; - CL_RETURN_ON_FAILURE( - clGetDeviceInfo(Dev, CL_DEVICE_EXTENSIONS, 0, nullptr, &ExtSize)); - - std::string ExtStr(ExtSize, '\0'); - CL_RETURN_ON_FAILURE(clGetDeviceInfo(Dev, CL_DEVICE_EXTENSIONS, ExtSize, - ExtStr.data(), nullptr)); - - std::string SupportedExtensions(ExtStr.c_str()); - if (ExtStr.find("cl_khr_command_buffer") != std::string::npos) { - SupportedExtensions += " ur_exp_command_buffer"; - } - return ReturnValue(SupportedExtensions.c_str()); - } case UR_DEVICE_INFO_UUID: { // Use the cl_khr_device_uuid extension, if available. @@ -1195,6 +1180,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(false); case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: return ReturnValue(false); + case UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP: + return ReturnValue(false); + case UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP: + return ReturnValue(true); + case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP: + return ReturnValue(false); default: { return UR_RESULT_ERROR_INVALID_ENUMERATION; } diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index 19ab908ee3..11acec093a 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -495,7 +495,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( if (pPropValue == NULL && pPropSizeRet == NULL) return UR_RESULT_ERROR_INVALID_NULL_POINTER; - if (UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP < propName) + if (UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP < propName) return UR_RESULT_ERROR_INVALID_ENUMERATION; if (propSize == 0 && pPropValue != NULL) diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index 5b55b71d4d..d5bc160e21 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -868,7 +868,7 @@ ur_result_t UR_APICALL urDeviceGetSelected( /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP < propName` +/// + `::UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE diff --git a/source/ur_api.cpp b/source/ur_api.cpp index 15cb0442b1..5a84c147e7 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -782,7 +782,7 @@ ur_result_t UR_APICALL urDeviceGetSelected( /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP < propName` +/// + `::UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE diff --git a/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp b/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp index 6501012bae..b960a49d8f 100644 --- a/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp +++ b/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp @@ -274,21 +274,10 @@ TEST_P(urEnqueueKernelLaunchIncrementMultiDeviceTest, Success) { auto waitOnEvent = std::get<0>(getParam()).value; auto runBackgroundCheck = std::get<1>(getParam()).value; - size_t returned_size; - ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_EXTENSIONS, 0, - nullptr, &returned_size)); - - std::unique_ptr returned_extensions(new char[returned_size]); - - ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_EXTENSIONS, - returned_size, returned_extensions.get(), + ur_bool_t usm_p2p_support = false; + ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP, + sizeof(usm_p2p_support), &usm_p2p_support, nullptr)); - - std::string_view extensions_string(returned_extensions.get()); - const bool usm_p2p_support = - extensions_string.find(UR_USM_P2P_EXTENSION_STRING_EXP) != - std::string::npos; - if (!usm_p2p_support) { GTEST_SKIP() << "EXP usm p2p feature is not supported."; } diff --git a/test/conformance/exp_command_buffer/fixtures.h b/test/conformance/exp_command_buffer/fixtures.h index 7f35e3e4f2..011bf0c2d0 100644 --- a/test/conformance/exp_command_buffer/fixtures.h +++ b/test/conformance/exp_command_buffer/fixtures.h @@ -16,20 +16,10 @@ namespace uur { namespace command_buffer { static void checkCommandBufferSupport(ur_device_handle_t device) { - size_t returned_size; - ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_EXTENSIONS, 0, nullptr, - &returned_size)); - - std::unique_ptr returned_extensions(new char[returned_size]); - - ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_EXTENSIONS, - returned_size, returned_extensions.get(), - nullptr)); - - std::string_view extensions_string(returned_extensions.get()); - bool command_buffer_support = - extensions_string.find(UR_COMMAND_BUFFER_EXTENSION_STRING_EXP) != - std::string::npos; + ur_bool_t command_buffer_support = false; + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP, + sizeof(command_buffer_support), &command_buffer_support, nullptr)); if (!command_buffer_support) { GTEST_SKIP() << "EXP command-buffer feature is not supported."; diff --git a/test/conformance/exp_launch_properties/launch_properties.cpp b/test/conformance/exp_launch_properties/launch_properties.cpp index 989d890b84..eb5ad36c11 100644 --- a/test/conformance/exp_launch_properties/launch_properties.cpp +++ b/test/conformance/exp_launch_properties/launch_properties.cpp @@ -22,21 +22,10 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEnqueueKernelLaunchCustomTest); TEST_P(urEnqueueKernelLaunchCustomTest, Success) { UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); - size_t returned_size; - ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_EXTENSIONS, 0, nullptr, - &returned_size)); - - std::unique_ptr returned_extensions(new char[returned_size]); - - ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_EXTENSIONS, - returned_size, returned_extensions.get(), - nullptr)); - - std::string_view extensions_string(returned_extensions.get()); - const bool launch_properties_support = - extensions_string.find(UR_LAUNCH_PROPERTIES_EXTENSION_STRING_EXP) != - std::string::npos; - + ur_bool_t launch_properties_support = false; + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP, + sizeof(launch_properties_support), &launch_properties_support, nullptr)); if (!launch_properties_support) { GTEST_SKIP() << "EXP launch properties feature is not supported."; } @@ -44,6 +33,7 @@ TEST_P(urEnqueueKernelLaunchCustomTest, Success) { std::vector props(1); props[0].id = UR_EXP_LAUNCH_PROPERTY_ID_IGNORE; + size_t returned_size = 0; ASSERT_SUCCESS(urDeviceGetInfo(device, UR_DEVICE_INFO_PROFILE, 0, nullptr, &returned_size)); diff --git a/test/conformance/exp_usm_p2p/usm_p2p.cpp b/test/conformance/exp_usm_p2p/usm_p2p.cpp index 687c425be5..d81edf2071 100644 --- a/test/conformance/exp_usm_p2p/usm_p2p.cpp +++ b/test/conformance/exp_usm_p2p/usm_p2p.cpp @@ -14,25 +14,15 @@ TEST_P(urP2PTest, Success) { GTEST_SKIP(); } - size_t returned_size; - ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_EXTENSIONS, 0, - nullptr, &returned_size)); - - std::unique_ptr returned_extensions(new char[returned_size]); - - ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_EXTENSIONS, - returned_size, returned_extensions.get(), + ur_bool_t usm_p2p_support = false; + ASSERT_SUCCESS(urDeviceGetInfo(devices[0], UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP, + sizeof(usm_p2p_support), &usm_p2p_support, nullptr)); - - std::string_view extensions_string(returned_extensions.get()); - const bool usm_p2p_support = - extensions_string.find(UR_USM_P2P_EXTENSION_STRING_EXP) != - std::string::npos; - if (!usm_p2p_support) { GTEST_SKIP() << "EXP usm p2p feature is not supported."; } + size_t returned_size = 0; int value; ASSERT_SUCCESS(urUsmP2PPeerAccessGetInfoExp( /// [in] handle of the command device object diff --git a/tools/urinfo/urinfo.hpp b/tools/urinfo/urinfo.hpp index c6409764a3..2a66303dd4 100644 --- a/tools/urinfo/urinfo.hpp +++ b/tools/urinfo/urinfo.hpp @@ -418,5 +418,16 @@ inline void printDeviceInfos(ur_device_handle_t hDevice, std::cout << prefix; printDeviceInfo( hDevice, UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP); + std::cout << prefix; + printDeviceInfo(hDevice, + UR_DEVICE_INFO_LAUNCH_PROPERTIES_SUPPORT_EXP); + std::cout << prefix; + printDeviceInfo(hDevice, UR_DEVICE_INFO_USM_P2P_SUPPORT_EXP); + std::cout << prefix; + printDeviceInfo(hDevice, + UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP); + std::cout << prefix; + printDeviceInfo(hDevice, + UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP); } } // namespace urinfo From 9c1c7c714ea7e642fc8ad5e96d84b68d7df39fc9 Mon Sep 17 00:00:00 2001 From: Aaron Greig Date: Tue, 12 Nov 2024 13:41:21 +0000 Subject: [PATCH 2/2] Fix incorrect enum value in multi-device compile. Also update DEVICE_INFO_EXTENSIONS description. --- include/ur_api.h | 5 +++-- scripts/core/device.yml | 2 +- scripts/core/exp-multi-device-compile.yml | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/ur_api.h b/include/ur_api.h index 716a72ab91..78727523c8 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -2069,7 +2069,8 @@ typedef enum ur_device_info_t { UR_DEVICE_INFO_VERSION = 70, /// [char[]] Version of backend runtime UR_DEVICE_INFO_BACKEND_RUNTIME_VERSION = 71, - /// [char[]] Return a space separated list of extension names + /// [char[]] Return a string representing any backend extensions supported + /// by the adapter. Format and content is entirely adapter defined. UR_DEVICE_INFO_EXTENSIONS = 72, /// [size_t] Maximum size in bytes of internal printf buffer UR_DEVICE_INFO_PRINTF_BUFFER_SIZE = 73, @@ -2307,7 +2308,7 @@ typedef enum ur_device_info_t { UR_DEVICE_INFO_COOPERATIVE_KERNEL_SUPPORT_EXP = 0x5000, /// [::ur_bool_t] Returns true if the device supports the multi device /// compile experimental feature. - UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP = 0x7000, + UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP = 0x6000, /// @cond UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff /// @endcond diff --git a/scripts/core/device.yml b/scripts/core/device.yml index c260303c87..eb98e83390 100644 --- a/scripts/core/device.yml +++ b/scripts/core/device.yml @@ -343,7 +343,7 @@ etors: - name: BACKEND_RUNTIME_VERSION desc: "[char[]] Version of backend runtime" - name: EXTENSIONS - desc: "[char[]] Return a space separated list of extension names" + desc: "[char[]] Return a string representing any backend extensions supported by the adapter. Format and content is entirely adapter defined." - name: PRINTF_BUFFER_SIZE desc: "[size_t] Maximum size in bytes of internal printf buffer" - name: PREFERRED_INTEROP_USER_SYNC diff --git a/scripts/core/exp-multi-device-compile.yml b/scripts/core/exp-multi-device-compile.yml index 247e2c4087..f3c275ca2d 100644 --- a/scripts/core/exp-multi-device-compile.yml +++ b/scripts/core/exp-multi-device-compile.yml @@ -12,8 +12,6 @@ type: header desc: "Intel $OneApi Unified Runtime Experimental APIs for multi-device compile" ordinal: "99" --- #-------------------------------------------------------------------------- -name: $X_MULTI_DEVICE_COMPILE_EXTENSION_STRING_EXP -value: "\"$x_exp_multi_device_compile\"" type: enum extend: true typed_etors: true @@ -21,7 +19,7 @@ desc: "Extension enums for $x_device_info_t to support multi device compile." name: $x_device_info_t etors: - name: MULTI_DEVICE_COMPILE_SUPPORT_EXP - value: "0x7000" + value: "0x6000" desc: "[$x_bool_t] Returns true if the device supports the multi device compile experimental feature." --- #-------------------------------------------------------------------------- type: function