From cc49caccabab5920d87ff529849275cb4b7973ed Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Mon, 11 Nov 2024 16:18:25 +0000 Subject: [PATCH] Update sn3d.h --- sn3d.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sn3d.h b/sn3d.h index ef1ff5f73..cdda59c52 100644 --- a/sn3d.h +++ b/sn3d.h @@ -133,7 +133,7 @@ __attribute__((__format__(__printf__, 1, 2))) inline auto printout(const char *f #define __artis_assert(e) \ { \ const bool assertpass = static_cast(e); \ - if (!assertpass) [[unlikely]] { \ + if (__builtin_expect(!assertpass, 0)) [[unlikely]] { \ const std::string strstacktrace = STACKTRACEIFSUPPORTED; \ if (output_file) { \ output_file << "\n[rank " << globals::my_rank << "] " << __FILE__ << ":" << __LINE__ << ": failed assertion `" \ @@ -149,7 +149,6 @@ __attribute__((__format__(__printf__, 1, 2))) inline auto printout(const char *f << std::flush; \ std::abort(); \ } \ - assert(assertpass); \ } #endif