Skip to content

Commit acee7b3

Browse files
author
Sergey Kanaev
committed
Change notion of macro so that it allows for both enabling and disabling of fallback assert
Signed-off-by: Sergey Kanaev <[email protected]>
1 parent c898503 commit acee7b3

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

sycl/doc/PreprocessorMacros.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ This file describes macros that have effect on SYCL compiler and run-time.
3838

3939
Disables a message which warns about unsupported C++ version.
4040

41-
- **SYCL_ENABLE_FALLBACK_ASSERT**
41+
- **SYCL_FALLBACK_ASSERT**
4242

43-
Defining this macro enables the fallback assert feature even on devices
43+
Defining as non-zero enables the fallback assert feature even on devices
4444
without native support. Be aware that this will add some overhead that is
4545
associated with submitting kernels that call `assert()`. When this macro is
4646
not defined, the logic for detecting assertion failures in kernels is
@@ -50,6 +50,7 @@ This file describes macros that have effect on SYCL compiler and run-time.
5050
these devices regardless of whether this macro is defined because that logic
5151
does not add any extra overhead. One can check to see if a device has native
5252
support for `assert()` via `aspect::ext_oneapi_native_assert`.
53+
Default value is 0.
5354

5455
## Version macros
5556

sycl/include/CL/sycl/queue.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767

6868
// Helper macro to identify if fallback assert is needed
6969
// FIXME remove __NVPTX__ condition once devicelib supports CUDA
70-
#if defined(SYCL_ENABLE_FALLBACK_ASSERT)
71-
#define __SYCL_USE_FALLBACK_ASSERT 1
70+
#if defined(SYCL_FALLBACK_ASSERT)
71+
#define __SYCL_USE_FALLBACK_ASSERT SYCL_FALLBACK_ASSERT
7272
#else
7373
#define __SYCL_USE_FALLBACK_ASSERT 0
7474
#endif

sycl/unittests/assert/assert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* pipe.
1919
*/
2020

21-
#define SYCL_ENABLE_FALLBACK_ASSERT 1
21+
#define SYCL_FALLBACK_ASSERT 1
2222
// Enable use of interop kernel c-tor
2323
#define __SYCL_INTERNAL_API
2424
#include <CL/sycl.hpp>

0 commit comments

Comments
 (0)