From: Bruno Turcksin Date: Sun, 9 Apr 2023 00:09:38 +0000 (+0000) Subject: Fix clang-tidy X-Git-Tag: v9.5.0-rc1~349^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=328b8f065bd705d7d6e0d99a69b951583a17f028;p=dealii.git Fix clang-tidy --- diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index 18f58566b4..85ec977c4d 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -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