From 1e834ebbfb204562896cd967d281ac0737b0c599 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 8 Feb 2023 17:13:50 -0500 Subject: [PATCH] Use Kokkos::abort directly --- include/deal.II/base/exceptions.h | 14 +++++++------- include/deal.II/base/kokkos.h | 7 ------- include/deal.II/base/tensor.h | 4 ++-- source/base/kokkos.cc | 6 ------ 4 files changed, 9 insertions(+), 22 deletions(-) diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index 71c7889bd7..2f7416e4f2 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -18,7 +18,7 @@ #include -#include +#include #include #include @@ -1524,7 +1524,7 @@ namespace deal_II_exceptions })) \ KOKKOS_IF_ON_DEVICE(({ \ if (!(cond)) \ - dealii::internal::kokkos_abort(#cond); \ + Kokkos::abort(#cond); \ })) \ } # else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ @@ -1544,7 +1544,7 @@ namespace deal_II_exceptions })) \ KOKKOS_IF_ON_DEVICE(({ \ if (!(cond)) \ - dealii::internal::kokkos_abort(#cond); \ + Kokkos::abort(#cond); \ })) \ } # endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ @@ -1580,10 +1580,10 @@ namespace deal_II_exceptions } # endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ # else /*#ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/ -# define Assert(cond, exc) \ - { \ - if (!(cond)) \ - dealii::internal::kokkos_abort(#cond); \ +# define Assert(cond, exc) \ + { \ + if (!(cond)) \ + Kokkos::abort(#cond); \ } # endif /*ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/ # endif /*KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/ diff --git a/include/deal.II/base/kokkos.h b/include/deal.II/base/kokkos.h index 29023986c0..70b5757c54 100644 --- a/include/deal.II/base/kokkos.h +++ b/include/deal.II/base/kokkos.h @@ -34,13 +34,6 @@ namespace internal void ensure_kokkos_initialized(); - /** - * Calls Kokkos::abort. This wrapper avoids including Kokkos_Core.hpp, which - * provides all of Kokkos' functionalities, on the call side. - */ - KOKKOS_FUNCTION void - kokkos_abort(const char *error); - } // namespace internal DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 1dc1dd9a12..eefd25c2fb 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1166,7 +1166,7 @@ namespace internal KOKKOS_IF_ON_DEVICE(({ (void)val; (void)s; - dealii::internal::kokkos_abort( + Kokkos::abort( "This function is not implemented for std::complex!\n"); })) # else @@ -1175,7 +1175,7 @@ namespace internal # else (void)val; (void)s; - dealii::internal::kokkos_abort( + Kokkos::abort( "This function is not implemented for std::complex!\n"); # endif # endif diff --git a/source/base/kokkos.cc b/source/base/kokkos.cc index 417efa5dec..5ea3b374c1 100644 --- a/source/base/kokkos.cc +++ b/source/base/kokkos.cc @@ -41,11 +41,5 @@ namespace internal (void)dummy; } } - - KOKKOS_FUNCTION void - kokkos_abort(const char *error) - { - Kokkos::abort(error); - } } // namespace internal DEAL_II_NAMESPACE_CLOSE -- 2.39.5