@@ -200,13 +200,8 @@ performed only when assertion is enabled and Device-side Runtime doesn't provide
200
200
implementation of ` __devicelib_assert_fail ` .
201
201
202
202
In DPCPP headers one can see if assert is enabled with status of ` NDEBUG ` macro
203
- with ` #ifdef ` 's. This allows to enqueue a copy kernel and host task. The copy
204
- kernel will copy ` AssertHappenedMem ` to host and host-task will check the ` Flag `
205
- value and ` abort() ` as needed. The kernel and host task are enqueued when
206
- ` NDEBUG ` macro isn't defined.
207
-
208
- When in DPCPP Runtime Library this knowledge is obtained from device binary
209
- image descriptor's property sets.
203
+ with ` #ifdef ` 's. When in DPCPP Runtime Library this knowledge is obtained from
204
+ device binary image descriptor's property sets.
210
205
211
206
Each device image is supplied with an array of property sets. For description
212
207
of property sets see ` struct pi_device_binary_struct ` in
@@ -347,6 +342,19 @@ fail.
347
342
348
343
### Raising assert failure flag and reading it on host
349
344
345
+ In DPCPP headers one can see if assert is enabled with status of ` NDEBUG ` macro
346
+ with ` #ifdef ` 's. Though, in order to support for multi translation unit use-case
347
+ it's not allowed to rely on definition of ` NDEBUG ` macro.
348
+
349
+ * Note: Multi translation unit use-case here is the one with ` SYCL_EXTERNAL `
350
+ function compiled with assertions enabled and used in a kernel but the kernel
351
+ is compiled with assertions disabled.*
352
+
353
+ There're two commands used for reading assert failure flag: copy kernel and
354
+ checker host task. The copy kernel will copy ` AssertHappenedMem ` to host and
355
+ host-task will check the ` Flag ` value and ` abort() ` as needed. The kernel and
356
+ host task are enqueued when ` NDEBUG ` macro isn't defined.
357
+
350
358
All translation units provided by the user should have a declaration of the
351
359
assert flag read function available:
352
360
``` c++
0 commit comments