From: Daniel Arndt Date: Fri, 5 Jul 2024 14:59:24 +0000 (-0400) Subject: Fix deal_II_exceptions::internal::abort [[noexcept]] attribute for old Kokkos X-Git-Tag: v9.6.0-rc1~133^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3430b0b776a6a45b83b6c86a60b571a69652692d;p=dealii.git Fix deal_II_exceptions::internal::abort [[noexcept]] attribute for old Kokkos --- diff --git a/source/base/exceptions.cc b/source/base/exceptions.cc index 50cd791f1d..918bb9c181 100644 --- a/source/base/exceptions.cc +++ b/source/base/exceptions.cc @@ -520,8 +520,19 @@ namespace deal_II_exceptions // Let's abort the program here. On the host, we need to call std::abort, // on devices we need to do something different. Kokkos::abort() does // the right thing in all circumstances. - Kokkos::abort( - "Abort() was called during dealing with an assertion or exception."); + if constexpr (std::is_same_v) + { + // FIXME_KOKKOS Older Kokkos versions don't declare Kokkos::abort as + // [[noreturn]]. In case Kokkos is only configured with host backends, + // we can just use std::abort instead. + std::abort(); + } + else + { + Kokkos::abort( + "Abort() was called during dealing with an assertion or exception."); + } }