Skip to content

Commit 2a51c3c

Browse files
[UR] Add device-wide synchronization extension (#20378)
This commit adds the ability to synchronize with all operations currently enqueued or executing on a given device. --------- Signed-off-by: Larsen, Steffen <[email protected]>
1 parent b87d667 commit 2a51c3c

34 files changed

+678
-1
lines changed

unified-runtime/include/ur_api.h

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

unified-runtime/include/ur_api_funcs.def

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

unified-runtime/include/ur_ddi.h

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

unified-runtime/include/ur_print.h

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

unified-runtime/include/ur_print.hpp

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<%
2+
OneApi=tags['$OneApi']
3+
x=tags['$x']
4+
X=x.upper()
5+
%>
6+
7+
.. _experimental-device-wait:
8+
9+
================================================================================
10+
Device Wait
11+
================================================================================
12+
13+
.. warning::
14+
15+
Experimental features:
16+
17+
* May be replaced, updated, or removed at any time.
18+
* Do not require maintaining API/ABI stability of their own additions over
19+
time.
20+
* Do not require conformance testing of their own additions.
21+
22+
23+
24+
Motivation
25+
--------------------------------------------------------------------------------
26+
27+
This extension adds the ability to do device-wide synchronization, instead of at
28+
queue or event level.
29+
30+
API
31+
--------------------------------------------------------------------------------
32+
33+
Enums
34+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35+
* ${x}_device_info_t
36+
* ${X}_DEVICE_INFO_DEVICE_WAIT_SUPPORT_EXP
37+
38+
Functions
39+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40+
41+
* ${x}DeviceWaitExp
42+
43+
Changelog
44+
--------------------------------------------------------------------------------
45+
46+
+-----------+---------------------------------------------+
47+
| Revision | Changes |
48+
+===========+=============================================+
49+
| 1.0 | Initial Draft |
50+
+-----------+---------------------------------------------+
51+
52+
Support
53+
--------------------------------------------------------------------------------
54+
55+
Adapters which support this experimental feature *must* return ``true`` when
56+
queried for ${X}_DEVICE_INFO_DEVICE_WAIT_SUPPORT_EXP via
57+
${x}DeviceGetInfo. Conversely, before using any of the functionality defined
58+
in this experimental feature the user *must* use the device query to determine
59+
if the adapter supports this feature.
60+
61+
Contributors
62+
--------------------------------------------------------------------------------
63+
64+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Copyright (C) 2023 Intel Corporation
3+
#
4+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See LICENSE.TXT
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
#
8+
# See YaML.md for syntax definition
9+
#
10+
--- #--------------------------------------------------------------------------
11+
type: header
12+
desc: "Intel $OneApi Unified Runtime Experimental APIs for device-wide synchronization"
13+
ordinal: "99"
14+
--- #--------------------------------------------------------------------------
15+
type: enum
16+
extend: true
17+
typed_etors: true
18+
desc: "Extension enums for $x_device_info_t to support device-wide synchronization."
19+
name: $x_device_info_t
20+
etors:
21+
- name: DEVICE_WAIT_SUPPORT_EXP
22+
value: "0x6002"
23+
desc: "[$x_bool_t] Returns true if the device supports the device-wide synchronization experimental feature."
24+
--- #--------------------------------------------------------------------------
25+
type: function
26+
desc: "Synchronizes with all queues on the device."
27+
class: $xDevice
28+
name: WaitExp
29+
decl: static
30+
ordinal: "1"
31+
params:
32+
- type: $x_device_handle_t
33+
name: hDevice
34+
desc: "[in] handle of the device instance."
35+
returns:
36+
- $X_RESULT_ERROR_INVALID_DEVICE
37+
- $X_RESULT_ERROR_INVALID_NULL_HANDLE:
38+
- "`hDevice == nullptr`"

unified-runtime/scripts/core/registry.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,10 @@ etors:
682682
- name: IPC_CLOSE_MEM_HANDLE_EXP
683683
desc: Enumerator for $xIPCCloseMemHandleExp
684684
value: '292'
685-
max_id: '292'
685+
- name: DEVICE_WAIT_EXP
686+
desc: Enumerator for $xDeviceWaitExp
687+
value: '293'
688+
max_id: '293'
686689
---
687690
type: enum
688691
desc: Defines structure types

unified-runtime/source/adapters/adapter.def.in

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

unified-runtime/source/adapters/adapter.map.in

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)