From aa3e6e69b436309b42bfc9cf679cdaaae1e793b8 Mon Sep 17 00:00:00 2001 From: James Beach Date: Sat, 2 May 2020 17:12:29 +0100 Subject: [PATCH] excludes std::abort from compilation when compiling CUDA with Clang as device code --- include/fmt/format-inl.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 71ee20f5..31963876 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -15,6 +15,7 @@ #include #include // for std::memmove #include +#include #include "format.h" #if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) @@ -47,7 +48,11 @@ namespace internal { FMT_FUNC void assert_fail(const char* file, int line, const char* message) { print(stderr, "{}:{}: assertion failed: {}", file, line, message); +#if defined(__clang__) && defined(__CUDA__) && defined(__CUDA_ARCH__) + std::terminate(); +#else std::abort(); +#endif } #ifndef _MSC_VER