From dd05c24e33c05f89a8383327fbce225950559f0f Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 6 Feb 2023 22:46:50 +0000 Subject: [PATCH] Remove is_cuda_compatible --- include/deal.II/base/numbers.h | 46 +------------------ .../differentiation/ad/sacado_number_types.h | 11 ----- 2 files changed, 2 insertions(+), 55 deletions(-) diff --git a/include/deal.II/base/numbers.h b/include/deal.II/base/numbers.h index 0e13bb2a41..26072316a7 100644 --- a/include/deal.II/base/numbers.h +++ b/include/deal.II/base/numbers.h @@ -267,22 +267,6 @@ namespace numbers */ static constexpr double SQRT1_2 = 0.70710678118654752440; - /** - * Check whether the given type can be used in CUDA device code. - * If not, DEAL_II_HOST_DEVICE needs to be disabled for functions - * that use this type. - */ - template - struct is_cuda_compatible : std::true_type - {}; - - /** - * std::complex cannot be used in CUDA device code. - */ - template - struct is_cuda_compatible, void> : std::false_type - {}; - /** * Return @p true if the given value is a finite floating point number, i.e. * is neither plus or minus infinity nor NaN (not a number). @@ -468,17 +452,7 @@ namespace numbers * @note If the template type can be used in CUDA device code, the same holds true * for this function. */ - template - static constexpr DEAL_II_HOST_DEVICE - std::enable_if_t::value && - is_cuda_compatible::value, - real_type> - abs_square(const number &x); - - template - static constexpr std::enable_if_t::value && - !is_cuda_compatible::value, - real_type> + static constexpr DEAL_II_HOST_DEVICE real_type abs_square(const number &x); /** @@ -595,23 +569,7 @@ namespace numbers template - template - constexpr DEAL_II_HOST_DEVICE - std::enable_if_t::value && - is_cuda_compatible::value, - typename NumberTraits::real_type> - NumberTraits::abs_square(const number &x) - { - return x * x; - } - - - - template - template - constexpr std::enable_if_t::value && - !is_cuda_compatible::value, - typename NumberTraits::real_type> + constexpr DEAL_II_HOST_DEVICE typename NumberTraits::real_type NumberTraits::abs_square(const number &x) { return x * x; diff --git a/include/deal.II/differentiation/ad/sacado_number_types.h b/include/deal.II/differentiation/ad/sacado_number_types.h index f55e0de9ca..0829716352 100644 --- a/include/deal.II/differentiation/ad/sacado_number_types.h +++ b/include/deal.II/differentiation/ad/sacado_number_types.h @@ -906,17 +906,6 @@ namespace Differentiation } // namespace Differentiation -namespace numbers -{ - template - struct is_cuda_compatible< - NumberType, - std::enable_if_t< - dealii::Differentiation::AD::is_sacado_rad_number::value>> - : std::false_type - {}; -} // namespace numbers - # endif // DOXYGEN -- 2.39.5