0
0
Fork 0
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:
Jason Volk 2022-10-09 00:56:58 +00:00
parent c1168fcc30
commit 831141727b

View file

@ -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)