mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd::gpt::gpu: Add assert macro when trapping supported.
This commit is contained in:
parent
c1168fcc30
commit
831141727b
1 changed files with 9 additions and 2 deletions
|
@ -13,10 +13,17 @@
|
|||
#pragma clang fp contract(fast)
|
||||
|
||||
#include <ircd/config.h>
|
||||
#include <ircd/portable.h>
|
||||
#include <clc/clc.h>
|
||||
|
||||
#if !defined(assume)
|
||||
#define assume(x) __builtin_assume(x)
|
||||
#if !defined(assert) \
|
||||
&& !defined(NDEBUG) \
|
||||
&& defined(RB_ASSERT_INTRINSIC) \
|
||||
&& __has_builtin(__builtin_trap) \
|
||||
&& __OPENCL_VERSION__ >= 200
|
||||
#define assert(x) ((void)(unlikely(!(bool)(x))? __builtin_trap(): 0))
|
||||
#else
|
||||
#define assert(x)
|
||||
#endif
|
||||
|
||||
#if defined(__SPIR)
|
||||
|
|
Loading…
Reference in a new issue