Skip to content

Commit 29bb178

Browse files
committed
Rename to "submit_profiling_tag"
We've been debating the name of this API, and this name seems to have some traction. Update to get wider feedback.
1 parent b6ac0fd commit 29bb178

File tree

2 files changed

+32
-38
lines changed

2 files changed

+32
-38
lines changed

sycl/doc/extensions/proposed/sycl_ext_oneapi_enqueue_functions.asciidoc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ syclex::submit(q, [&](sycl::handler& h) {
133133
float* output = sycl::malloc_shared<int>(1, q);
134134
*output = 0;
135135
std::vector<sycl::event> depEvents = /* some dependencies */;
136-
sycl::event e = syclex::submit_and_record(q, [&](sycl::handler& h) {
136+
sycl::event e = syclex::submit_with_event(q, [&](sycl::handler& h) {
137137
h.depends_on(depEvents);
138138
syclex::nd_launch(h, sycl::nd_range<1>{1024, 16},
139139
[=](sycl::nd_item<1> it, auto& sum) {
@@ -247,7 +247,7 @@ a!
247247
namespace sycl::ext::oneapi::experimental {
248248
249249
template <typename CommandGroupFunc>
250-
sycl::event submit_and_record(sycl::queue q, CommandGroupFunc&& cgf);
250+
sycl::event submit_with_event(sycl::queue q, CommandGroupFunc&& cgf);
251251
252252
}
253253
----
@@ -711,13 +711,12 @@ _{endnote}_]
711711

712712
== Issues
713713

714-
. Is the name `submit_and_record` confusing?
714+
. What should `submit_with_event` be called?
715715
+
716716
--
717-
*UNRESOLVED*: An advantage with the current name is that it sets up a naming
718-
pattern with `record_event`, where functions with the word "record" in their
719-
name return an event. However, the word "record" may be confused with the
720-
recording functionality associated with SYCL graphs.
717+
*UNRESOLVED*: `submit_with_event` is descriptive but verbose. Synonyms for
718+
`submit` like `enqueue` do not obviously mean "return an event". `record` may
719+
be confused with the recording functionality associated with SYCL graphs.
721720
--
722721

723722
. What about `accessor` overloads and `update_host`?

sycl/doc/extensions/proposed/sycl_ext_oneapi_record_event.asciidoc renamed to sycl/doc/extensions/proposed/sycl_ext_oneapi_profiling_tag.asciidoc

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= sycl_ext_oneapi_record_event
1+
= sycl_ext_oneapi_profiling_tag
22

33
:source-highlighter: coderay
44
:coderay-linenums-mode: table
@@ -78,7 +78,8 @@ sycl_ext_oneapi_enqueue_functions]
7878
This extension provides a feature-test macro as described in the core SYCL
7979
specification.
8080
An implementation supporting this extension must predefine the macro
81-
`SYCL_EXT_ONEAPI_RECORD_EVENT` to one of the values defined in the table below.
81+
`SYCL_EXT_ONEAPI_PROFILING_TAG` to one of the values defined in the table
82+
below.
8283
Applications can test for the existence of this macro to determine if the
8384
implementation supports this feature, or applications can test the macro's
8485
value to determine which of the extension's features the implementation
@@ -96,22 +97,22 @@ supports.
9697

9798
=== New device aspect
9899

99-
This extension adds the `ext_oneapi_queue_event_recording` enumerator to the
100+
This extension adds the `ext_oneapi_queue_profiling_tag` enumerator to the
100101
`sycl::aspect` enumeration.
101102

102103
```
103104
namespace sycl {
104105

105106
enum class aspect : /*unspecified*/ {
106-
ext_oneapi_queue_event_recording
107+
ext_oneapi_queue_profiling_tag
107108
};
108109

109110
} // namespace sycl
110111
```
111112

112-
When a device has this aspect, the `record_event` function may be called for a
113-
queue on this device even if the queue is not constructed with the property
114-
`property::queue::enable_profiling`.
113+
When a device has this aspect, the `submit_profiling_tag` function may be
114+
called for a queue on this device even if the queue is not constructed with the
115+
property `property::queue::enable_profiling`.
115116

116117
=== New free function
117118

@@ -126,22 +127,28 @@ a!
126127
----
127128
namespace sycl::ext::oneapi::experimental {
128129
129-
event record_event(const queue& q);
130+
event submit_profiling_tag(const queue& q);
130131
131132
} // namespace sycl::ext::oneapi::experimental
132133
----
133134
!====
134135

135-
_Effects:_ Enqueues a command barrier to `q`.
136+
_Effects:_ If the queue `q` is out-of-order (i.e. was not constructed with
137+
`property::queue::in_order`), this function enqueues a command barrier to `q`.
136138
Any commands submitted after this barrier cannot begin execution until all
137139
previously submitted commands have completed.
138-
139-
_Returns:_ An event which represents the completion of the barrier.
140-
The event's status becomes `info::event_command_status::complete` when all
141-
commands submitted to the queue prior to the call to `record_event` have
142-
completed.
140+
If this queue is in-order, this function simply enqueues a lightweight "tag"
141+
command that marks the current head of the queue.
142+
143+
_Returns:_ If the queue is out-of-order, returns an event which represents the
144+
completion of the barrier.
145+
If the queue is in-order, returns an event which represents the completion of
146+
the "tag" command.
147+
In either case, the event's status becomes
148+
`info::event_command_status::complete` when all commands submitted to the queue
149+
prior to the call to `submit_profiling_tag` have completed.
143150
The event's `info::event_profiling::command_submit` timestamp reflects the
144-
time at which `record_event` is called.
151+
time at which `submit_profiling_tag` is called.
145152
The event's `info::event_profiling::command_end` timestamp reflects the time
146153
at which the event enters the "complete" state.
147154

@@ -155,7 +162,7 @@ Implementations are encouraged to transition the event directly from the
155162
_Throws:_ A synchronous `exception` with the `errc::invalid` error code if the
156163
queue was not constructed with the `property::queue::enable_profiling` property
157164
and if the queue's device does not have the aspect
158-
`ext_oneapi_queue_event_recording`.
165+
`ext_oneapi_queue_profiling_tag`.
159166

160167
[_Note:_ In order to understand why the "command_start" and "command_end"
161168
timestamps are encouraged to be the same, think of the barrier as an empty
@@ -185,17 +192,17 @@ static constexpr size_t N = 1024;
185192
int main() {
186193
sycl::queue q;
187194

188-
if (!q.get_device().has(sycl::aspect::ext_oneapi_queue_event_recording)) {
195+
if (!q.get_device().has(sycl::aspect::ext_oneapi_queue_profiling_tag)) {
189196
std::cout << "Cannot time kernels without enabling profiling on queue\n";
190197
return;
191198
}
192199

193200
// commands submitted here are not timed
194201

195-
sycl::event start = syclex::record_event(q);
202+
sycl::event start = syclex::submit_profiling_tag(q);
196203
sycl::parallel_for(q, {N}, [=](auto i) {/* first kernel */});
197204
sycl::parallel_for(q, {N}, [=](auto i) {/* second kernel */});
198-
sycl::event end = syclex::record_event(q);
205+
sycl::event end = syclex::submit_profiling_tag(q);
199206

200207
q.wait();
201208

@@ -205,15 +212,3 @@ int main() {
205212
std::cout << "Execution time: " << elapsed << " (nanoseconds)\n";
206213
}
207214
```
208-
209-
210-
== Issues
211-
212-
. Is the name `record_event` confusing?
213-
+
214-
--
215-
*UNRESOLVED*: The current name is similar to the CUDA API `cudaEventRecord`,
216-
which has similar functionality.
217-
However, the word "record" may be confused with the recording functionality
218-
associated with SYCL graphs.
219-
--

0 commit comments

Comments
 (0)