Skip to content

Commit 24d3a3c

Browse files
committed
Revamp API
After discussing various designs, we think we will need to keep a list of unconsumed async errors in the device object anyway. Therefore, it won't be hard to implement the same `wait`, `wait_and_throw`, and `throw_asynchronous` APIs as `queue`.
1 parent 48acaf0 commit 24d3a3c

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

sycl/doc/extensions/proposed/sycl_ext_oneapi_device_wait.asciidoc

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ enum class aspect {
106106
ext_oneapi_device_wait
107107
----
108108

109-
Indicates that the device supports the `device::ext_oneapi_wait_and_throw`
110-
member functions.
109+
Indicates that the device supports the member functions described below.
111110

112111
'''
113112

@@ -121,8 +120,9 @@ namespace sycl {
121120
122121
class device {
123122
// ...
124-
void ext_oneapi_wait_and_throw(async_handler h);
123+
void ext_oneapi_wait();
125124
void ext_oneapi_wait_and_throw();
125+
void ext_oneapi_throw_asynchronous();
126126
};
127127
128128
} // namespace sycl
@@ -132,14 +132,11 @@ class device {
132132

133133
[source,c++]
134134
----
135-
void ext_oneapi_wait_and_throw(async_handler h);
135+
void ext_oneapi_wait();
136136
----
137137

138138
_Effects:_ Blocks the calling thread until all commands previously submitted to
139139
any queue on this device have completed.
140-
Any unconsumed asynchronous errors from these commands are reported to the
141-
`h` handler as defined in section 4.13.1.1 "Asynchronous error handler" of the
142-
core SYCL specification.
143140

144141
_Throws:_ A synchronous `exception` with the `errc::feature_not_supported`
145142
error code if the device does not have `aspect::ext_oneapi_device_wait`.
@@ -153,17 +150,29 @@ void ext_oneapi_wait_and_throw();
153150

154151
_Effects:_ Blocks the calling thread until all commands previously submitted to
155152
any queue on this device have completed.
156-
Any unconsumed asynchronous errors from these commands are reported to the
157-
default async handler as defined in section 4.13.1.2 "Behavior without an async
158-
handler" of the core SYCL specification.
153+
154+
At least all unconsumed asynchronous errors held by any queue (or its associated
155+
context) on this device are passed to the appropriate async_handler as described
156+
in section 4.13.1.3 "Priorities of async handlers" of the core SYCL
157+
specification.
159158

160159
_Throws:_ A synchronous `exception` with the `errc::feature_not_supported`
161160
error code if the device does not have `aspect::ext_oneapi_device_wait`.
162161

163-
[_Note:_ The default async handler terminates the application when an
164-
asynchronous error occurs, so applications should use the other overload of
165-
`ext_oneapi_wait_and_throw` if they want to handle these errors.
166-
_{endnote}_]
162+
'''
163+
164+
[source,c++]
165+
----
166+
void ext_oneapi_throw_asynchronous();
167+
----
168+
169+
_Effects:_ Checks to see if any unconsumed asynchronous errors have been
170+
produced by any queue (or its associated context) on this device.
171+
If so, they are passed to the appropriate async_handler as described in section
172+
4.13.1.3 "Priorities of async handlers" of the core SYCL specification.
173+
174+
_Throws:_ A synchronous `exception` with the `errc::feature_not_supported`
175+
error code if the device does not have `aspect::ext_oneapi_device_wait`.
167176

168177
'''
169178

0 commit comments

Comments
 (0)