Skip to content

Commit 276cc80

Browse files
committed
Move properties argument and fix editorial issues
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 19cdc17 commit 276cc80

File tree

3 files changed

+38
-20
lines changed

3 files changed

+38
-20
lines changed

sycl/doc/extensions/experimental/sycl_ext_oneapi_enqueue_functions.asciidoc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,11 @@ a!
230230
----
231231
namespace sycl::ext::oneapi::experimental {
232232
233-
template <typename CommandGroupFunc, typename Properties = empty_properties_t>
234-
void submit(sycl::queue q, CommandGroupFunc&& cgf, Properties properties = {});
233+
template <typename CommandGroupFunc>
234+
void submit(sycl::queue q, CommandGroupFunc&& cgf);
235+
236+
template <typename CommandGroupFunc, typename Properties>
237+
void submit(sycl::queue q, Properties properties, CommandGroupFunc&& cgf);
235238
236239
}
237240
----
@@ -247,9 +250,12 @@ a!
247250
----
248251
namespace sycl::ext::oneapi::experimental {
249252
250-
template <typename CommandGroupFunc, typename Properties = empty_properties_t>
251-
sycl::event submit_with_event(sycl::queue q, CommandGroupFunc&& cgf,
252-
Properties properties = {});
253+
template <typename CommandGroupFunc>
254+
sycl::event submit_with_event(sycl::queue q, CommandGroupFunc&& cgf);
255+
256+
template <typename CommandGroupFunc, typename Properties>
257+
sycl::event submit_with_event(sycl::queue q, Properties properties,
258+
CommandGroupFunc&& cgf);
253259
254260
}
255261
----

sycl/doc/extensions/proposed/sycl_ext_intel_low_power_event.asciidoc

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,9 @@ incompatible ways before it is finalized. *Shipping software products should
5959
not rely on APIs defined in this specification.*
6060

6161

62-
== Backend support status
63-
64-
This extension is currently implemented in {dpcpp} only for all device targets.
65-
6662
== Overview
6763

68-
On some backends, calling `wait()` on a `event` will synchronize using a
64+
On some backends, calling `wait()` on an `event` will synchronize using a
6965
busy-waiting implementation. Though this comes at a low latency for the
7066
synchronization of the event, it has the downside of consuming high amounts of
7167
CPU time for no meaningful work. This extension introduces a new property for
@@ -82,7 +78,7 @@ cost of latency.
8278

8379
This extension provides a feature-test macro as described in the core SYCL
8480
specification. An implementation supporting this extension must predefine the
85-
macro `SYCL_EXT_ONEAPI_LOW_POWER_EVENT` to one of the values defined in the table
81+
macro `SYCL_EXT_INTEL_LOW_POWER_EVENT` to one of the values defined in the table
8682
below. Applications can test for the existence of this macro to determine if
8783
the implementation supports this feature, or applications can test the macro's
8884
value to determine which of the extension's features the implementation
@@ -104,9 +100,9 @@ supports.
104100
This extension adds a new property which can be used with the
105101
`submit_with_event` free function from
106102
link:../experimental/sycl_ext_oneapi_enqueue_functions.asciidoc[sycl_ext_oneapi_enqueue_functions].
107-
Passing this property to either of these functions will act as a hint to the
108-
`event` created from the corresponding commands to do low-power synchronization.
109-
If the backend is able to handle low-power events, calling `event::wait()` or
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
110106
`event::wait_and_throw()` will cause the thread to yield and only do occasional
111107
wake-ups to check the event progress.
112108

@@ -146,9 +142,10 @@ int main() {
146142
oneapiex::submit(Q, [&](sycl::handler &CGH) {...});
147143

148144
// Submit a command with the low-power event property.
149-
sycl::event E = oneapiex::submit_with_event(Q, [&](sycl::handler &CGH) {
145+
oneapiex::properties Props{intelex::low_power_event};
146+
sycl::event E = oneapiex::submit_with_event(Q, Props, [&](sycl::handler &CGH) {
150147
...
151-
}, oneapiex::properties{intelex::low_power_event});
148+
});
152149

153150
// Waiting for the resulting event will use low-power waiting if possible.
154151
E.wait();

sycl/include/sycl/ext/oneapi/experimental/enqueue_functions.hpp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,38 @@ void submit_impl(queue &Q, CommandGroupFunc &&CGF,
9595
}
9696
} // namespace detail
9797

98-
template <typename CommandGroupFunc, typename PropertiesT = empty_properties_t>
99-
void submit(queue Q, CommandGroupFunc &&CGF, PropertiesT Props = {},
98+
template <typename CommandGroupFunc, typename PropertiesT>
99+
void submit(queue Q, PropertiesT Props, CommandGroupFunc &&CGF,
100100
const sycl::detail::code_location &CodeLoc =
101101
sycl::detail::code_location::current()) {
102102
std::ignore = Props;
103103
sycl::ext::oneapi::experimental::detail::submit_impl(
104104
Q, std::forward<CommandGroupFunc>(CGF), CodeLoc);
105105
}
106106

107-
template <typename CommandGroupFunc, typename PropertiesT = empty_properties_t>
108-
event submit_with_event(queue Q, CommandGroupFunc &&CGF, PropertiesT Props = {},
107+
template <typename CommandGroupFunc>
108+
void submit(queue Q, CommandGroupFunc &&CGF,
109+
const sycl::detail::code_location &CodeLoc =
110+
sycl::detail::code_location::current()) {
111+
submit(Q, empty_properties_t{}, CGF, CodeLoc);
112+
}
113+
114+
template <typename CommandGroupFunc, typename PropertiesT>
115+
event submit_with_event(queue Q, PropertiesT Props, CommandGroupFunc &&CGF,
109116
const sycl::detail::code_location &CodeLoc =
110117
sycl::detail::code_location::current()) {
111118
std::ignore = Props;
112119
return Q.submit(std::forward<CommandGroupFunc>(CGF), CodeLoc);
113120
}
114121

122+
template <typename CommandGroupFunc>
123+
event submit_with_event(queue Q, CommandGroupFunc &&CGF,
124+
const sycl::detail::code_location &CodeLoc =
125+
sycl::detail::code_location::current()) {
126+
return submit_with_event(Q, std::forward<CommandGroupFunc>(CGF),
127+
empty_properties_t{}, CodeLoc);
128+
}
129+
115130
template <typename KernelName = sycl::detail::auto_name, typename KernelType>
116131
void single_task(handler &CGH, const KernelType &KernelObj) {
117132
CGH.single_task<KernelName>(KernelObj);

0 commit comments

Comments
 (0)