0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-13 08:23:56 +01:00

ircd::simt: Improve assert related; fix 83114172 argument name.

This commit is contained in:
Jason Volk 2022-10-18 20:14:48 +00:00
parent 2609c21913
commit a50f9fbd1b

View file

@ -15,17 +15,23 @@
// Trapping assert() on supporting platforms.
//
#if defined(__OPENCL_VERSION__)
// assert macro is ignored/untouched unless outer conditions met
#if defined(__OPENCL_VERSION__) \
&& !defined(assert) \
&& true
// assert expression is enabled or elided
#if __OPENCL_VERSION__ >= 200 \
&& !defined(assert) \
&& __has_builtin(__builtin_trap) \
&& !defined(NDEBUG) \
&& __has_builtin(__builtin_trap)
#define assert(expr) \
({ \
if(unlikely(!(bool)(x))) \
__builtin_trap(); \
&& true
#define assert(expr) \
({ \
if(unlikely(!(bool)(expr))) \
__builtin_trap(); \
})
#else
#define assert(x)
#define assert(expr)
#endif
#endif