excludes std::abort from compilation when compiling CUDA with Clang as device code

This commit is contained in:
James Beach 2020-05-02 17:12:29 +01:00
parent d59751f0f0
commit aa3e6e69b4

View File

@ -15,6 +15,7 @@
#include <cstdarg> #include <cstdarg>
#include <cstring> // for std::memmove #include <cstring> // for std::memmove
#include <cwchar> #include <cwchar>
#include <exception>
#include "format.h" #include "format.h"
#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) #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) { FMT_FUNC void assert_fail(const char* file, int line, const char* message) {
print(stderr, "{}:{}: assertion failed: {}", file, line, message); print(stderr, "{}:{}: assertion failed: {}", file, line, message);
#if defined(__clang__) && defined(__CUDA__) && defined(__CUDA_ARCH__)
std::terminate();
#else
std::abort(); std::abort();
#endif
} }
#ifndef _MSC_VER #ifndef _MSC_VER