]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix clang-tidy 15003/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Sun, 9 Apr 2023 00:09:38 +0000 (00:09 +0000)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Sun, 9 Apr 2023 00:09:38 +0000 (00:09 +0000)
include/deal.II/base/utilities.h

index 18f58566b475f7a59e0b0caa228896567c649599..85ec977c4dc3bd5d6e6186d4a6537570b8b9d9b4 100644 (file)
@@ -449,16 +449,33 @@ namespace Utilities
 #if defined(DEBUG) && !defined(DEAL_II_CXX14_CONSTEXPR_BUG)
     // Up to __builtin_expect this is the same code as in the 'Assert' macro.
     // The call to __builtin_expect turns out to be problematic.
-    KOKKOS_IF_ON_HOST((if (!(iexp >= 0))::dealii::deal_II_exceptions::
-                         internals::issue_error_noreturn(
-                           ::dealii::deal_II_exceptions::internals::
-                             ExceptionHandling::abort_or_throw_on_exception,
-                           __FILE__,
-                           __LINE__,
-                           __PRETTY_FUNCTION__,
-                           "iexp>=0",
-                           "ExcMessage(\"The exponent must not be negative!\")",
-                           ExcMessage("The exponent must not be negative!"));))
+#  if KOKKOS_VERSION >= 30600
+    KOKKOS_IF_ON_HOST(({
+      if (!(iexp >= 0))
+        ::dealii::deal_II_exceptions::internals::issue_error_noreturn(
+          ::dealii::deal_II_exceptions::internals::ExceptionHandling::
+            abort_or_throw_on_exception,
+          __FILE__,
+          __LINE__,
+          __PRETTY_FUNCTION__,
+          "iexp>=0",
+          "ExcMessage(\"The exponent must not be negative!\")",
+          ExcMessage("The exponent must not be negative!"));
+    }))
+#  else
+#    ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST
+    if (!(iexp >= 0))
+      ::dealii::deal_II_exceptions::internals::issue_error_noreturn(
+        ::dealii::deal_II_exceptions::internals::ExceptionHandling::
+          abort_or_throw_on_exception,
+        __FILE__,
+        __LINE__,
+        __PRETTY_FUNCTION__,
+        "iexp>=0",
+        "ExcMessage(\"The exponent must not be negative!\")",
+        ExcMessage("The exponent must not be negative!"));
+#    endif
+#  endif
 #endif
     // The "exponentiation by squaring" algorithm used below has to be
     // compressed to one statement due to C++11's restrictions on constexpr

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.