Skip to content

Commit f96675e

Browse files
committed
Switch to event-mode property
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 56129d1 commit f96675e

File tree

1 file changed

+36
-24
lines changed

1 file changed

+36
-24
lines changed

sycl/doc/extensions/proposed/sycl_ext_intel_low_power_event.asciidoc renamed to sycl/doc/extensions/proposed/sycl_ext_intel_event_mode.asciidoc

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= sycl_ext_intel_low_power_event
1+
= sycl_ext_intel_event_mode
22

33
:source-highlighter: coderay
44
:coderay-linenums-mode: table
@@ -65,11 +65,12 @@ On some backends, calling `wait()` on an `event` will synchronize using a
6565
busy-waiting implementation. Though this comes at a low latency for the
6666
synchronization of the event, it has the downside of consuming high amounts of
6767
CPU time for no meaningful work. This extension introduces a new property for
68-
SYCL commands that will produce a "low-power" event. These new low-power events
69-
will, if possible, yield the thread that the `wait()` member function is called
70-
on and only wake up occasionally to check if the event has finished. This
71-
reduces the time the CPU spends checking finish condition of the wait, at the
72-
cost of latency.
68+
SYCL commands that allow users to pick modes for the associated events, one of
69+
these modes being a "low-power" event. These new low-power events will, if
70+
possible, yield the thread that the `wait()` member function is called on and
71+
only wake up occasionally to check if the event has finished. This reduces the
72+
time the CPU spends checking finish condition of the wait, at the cost of
73+
latency.
7374

7475

7576
== Specification
@@ -78,7 +79,7 @@ cost of latency.
7879

7980
This extension provides a feature-test macro as described in the core SYCL
8081
specification. An implementation supporting this extension must predefine the
81-
macro `SYCL_EXT_INTEL_LOW_POWER_EVENT` to one of the values defined in the table
82+
macro `SYCL_EXT_INTEL_EVENT_MODE` to one of the values defined in the table
8283
below. Applications can test for the existence of this macro to determine if
8384
the implementation supports this feature, or applications can test the macro's
8485
value to determine which of the extension's features the implementation
@@ -95,35 +96,46 @@ supports.
9596
|===
9697

9798

98-
=== Low-power event property
99+
=== Event mode property
99100

100-
This extension adds a new property which can be used with the
101+
This extension adds a new property `event_mode` which can be used with the
101102
`submit_with_event` free function from
102-
link:../experimental/sycl_ext_oneapi_enqueue_functions.asciidoc[sycl_ext_oneapi_enqueue_functions].
103-
Passing this property to this function will act as a hint to the `event` created
104-
from the corresponding commands to do low-power synchronization. If the backend
105-
is able to handle low-power events, calling `event::wait()` or
106-
`event::wait_and_throw()` will cause the thread to yield and only do occasional
107-
wake-ups to check the event progress.
108-
109-
[_Note:_ The property currently only has an effect on `barrier` and
110-
`partial_barrier` commands enqueued on queues that return
111-
`backend::ext_oneapi_level_zero` from `queue::get_backend()`.
112-
_{endnote}_]
103+
link:../experimental/sycl_ext_oneapi_enqueue_functions.asciidoc[sycl_ext_oneapi_enqueue_functions],
104+
allowing the user some control over how the resulting event is created and
105+
managed.
113106

114107
```
115108
namespace sycl::ext::intel::experimental {
116109

117-
struct low_power_event_key {
118-
using value_t =
119-
oneapi::experimental::property_value<low_power_event_key>;
110+
enum class event_modes { none, low_power };
111+
112+
struct event_mode {
113+
event_mode(event_modes mode);
114+
115+
event_modes value;
120116
};
121117

122-
inline constexpr low_power_event_key::value_t low_power_event;
118+
using event_mode_key = event_mode;
123119

124120
} // namespace sycl::ext::intel::experimental
125121
```
126122

123+
124+
=== Low power event mode
125+
126+
Passing the `event_mode` property with `event_modes::low_power` to
127+
`submit_with_event` will act as a hint to the `event` created from the
128+
corresponding commands to do low-power synchronization. If the backend is able
129+
to handle low-power events, calling `event::wait()` or `event::wait_and_throw()`
130+
will cause the thread to yield and only do occasional wake-ups to check the
131+
event progress.
132+
133+
[_Note:_ The low-power event mode currently only has an effect on `barrier` and
134+
`partial_barrier` commands enqueued on queues that return
135+
`backend::ext_oneapi_level_zero` from `queue::get_backend()`.
136+
_{endnote}_]
137+
138+
127139
=== New property usage example
128140

129141
As an example of how to use the new `low_power_event` property, see the

0 commit comments

Comments
 (0)