From 3430b0b776a6a45b83b6c86a60b571a69652692d Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 5 Jul 2024 10:59:24 -0400 Subject: [PATCH] Fix deal_II_exceptions::internal::abort [[noexcept]] attribute for old Kokkos --- source/base/exceptions.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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."); + } } -- 2.39.5