diff --git a/common/src/KokkosFFT_Helpers.hpp b/common/src/KokkosFFT_Helpers.hpp index 6b69efa4..01872fd7 100644 --- a/common/src/KokkosFFT_Helpers.hpp +++ b/common/src/KokkosFFT_Helpers.hpp @@ -181,7 +181,7 @@ namespace KokkosFFT { template auto fftfreq(const ExecutionSpace&, const std::size_t n, const RealType d = 1.0) { - static_assert(std::is_floating_point::value, + static_assert(KokkosFFT::Impl::is_real_v, "fftfreq: d must be float or double"); using ViewType = Kokkos::View; ViewType freq("freq", n); @@ -216,7 +216,7 @@ auto fftfreq(const ExecutionSpace&, const std::size_t n, template auto rfftfreq(const ExecutionSpace&, const std::size_t n, const RealType d = 1.0) { - static_assert(std::is_floating_point::value, + static_assert(KokkosFFT::Impl::is_real_v, "fftfreq: d must be float or double"); using ViewType = Kokkos::View; diff --git a/common/src/KokkosFFT_layouts.hpp b/common/src/KokkosFFT_layouts.hpp index 800ba5d5..a555c990 100644 --- a/common/src/KokkosFFT_layouts.hpp +++ b/common/src/KokkosFFT_layouts.hpp @@ -64,9 +64,9 @@ auto get_extents(const InViewType& in, const OutViewType& out, _fft_extents.push_back(fft_extent); } - if (std::is_floating_point::value) { + if (is_real_v) { // Then R2C - if (is_complex::value) { + if (is_complex_v) { assert(_out_extents.at(inner_most_axis) == _in_extents.at(inner_most_axis) / 2 + 1); } else { @@ -75,9 +75,9 @@ auto get_extents(const InViewType& in, const OutViewType& out, } } - if (std::is_floating_point::value) { + if (is_real_v) { // Then C2R - if (is_complex::value) { + if (is_complex_v) { assert(_in_extents.at(inner_most_axis) == _out_extents.at(inner_most_axis) / 2 + 1); } else { diff --git a/common/src/KokkosFFT_padding.hpp b/common/src/KokkosFFT_padding.hpp index 6889ddbd..b1a72a27 100644 --- a/common/src/KokkosFFT_padding.hpp +++ b/common/src/KokkosFFT_padding.hpp @@ -70,8 +70,7 @@ auto get_modified_shape(const InViewType in, const OutViewType /* out */, using in_value_type = typename InViewType::non_const_value_type; using out_value_type = typename OutViewType::non_const_value_type; - bool is_C2R = is_complex::value && - std::is_floating_point_v; + bool is_C2R = is_complex_v && is_real_v; if (is_C2R) { int reshaped_axis = positive_axes.back(); diff --git a/fft/src/KokkosFFT_Plans.hpp b/fft/src/KokkosFFT_Plans.hpp index 34049d32..ec19fc99 100644 --- a/fft/src/KokkosFFT_Plans.hpp +++ b/fft/src/KokkosFFT_Plans.hpp @@ -186,14 +186,14 @@ class Plan { ExecutionSpace, typename OutViewType::memory_space>::accessible, "Plan::Plan: execution_space cannot access data in OutViewType"); - if (std::is_floating_point::value && + if (KokkosFFT::Impl::is_real_v && m_direction != KokkosFFT::Direction::forward) { throw std::runtime_error( "Plan::Plan: real to complex transform is constrcuted with backward " "direction."); } - if (std::is_floating_point::value && + if (KokkosFFT::Impl::is_real_v && m_direction != KokkosFFT::Direction::backward) { throw std::runtime_error( "Plan::Plan: complex to real transform is constrcuted with forward " diff --git a/fft/src/KokkosFFT_Transform.hpp b/fft/src/KokkosFFT_Transform.hpp index 6cf80d72..c8ac41b2 100644 --- a/fft/src/KokkosFFT_Transform.hpp +++ b/fft/src/KokkosFFT_Transform.hpp @@ -292,9 +292,9 @@ void rfft(const ExecutionSpace& exec_space, const InViewType& in, using in_value_type = typename InViewType::non_const_value_type; using out_value_type = typename OutViewType::non_const_value_type; - static_assert(std::is_floating_point::value, + static_assert(KokkosFFT::Impl::is_real_v, "rfft: InViewType must be real"); - static_assert(KokkosFFT::Impl::is_complex::value, + static_assert(KokkosFFT::Impl::is_complex_v, "rfft: OutViewType must be complex"); fft(exec_space, in, out, norm, axis, n); @@ -341,9 +341,9 @@ void irfft(const ExecutionSpace& exec_space, const InViewType& in, using in_value_type = typename InViewType::non_const_value_type; using out_value_type = typename OutViewType::non_const_value_type; - static_assert(KokkosFFT::Impl::is_complex::value, + static_assert(KokkosFFT::Impl::is_complex_v, "irfft: InViewType must be complex"); - static_assert(std::is_floating_point::value, + static_assert(KokkosFFT::Impl::is_real_v, "irfft: OutViewType must be real"); ifft(exec_space, in, out, norm, axis, n); } @@ -391,9 +391,9 @@ void hfft(const ExecutionSpace& exec_space, const InViewType& in, // type using in_value_type = typename InViewType::non_const_value_type; using out_value_type = typename OutViewType::non_const_value_type; - static_assert(KokkosFFT::Impl::is_complex::value, + static_assert(KokkosFFT::Impl::is_complex_v, "hfft: InViewType must be complex"); - static_assert(std::is_floating_point::value, + static_assert(KokkosFFT::Impl::is_real_v, "hfft: OutViewType must be real"); auto new_norm = KokkosFFT::Impl::swap_direction(norm); // using ComplexViewType = typename @@ -444,9 +444,9 @@ void ihfft(const ExecutionSpace& exec_space, const InViewType& in, using in_value_type = typename InViewType::non_const_value_type; using out_value_type = typename OutViewType::non_const_value_type; - static_assert(std::is_floating_point::value, + static_assert(KokkosFFT::Impl::is_real_v, "ihfft: InViewType must be real"); - static_assert(KokkosFFT::Impl::is_complex::value, + static_assert(KokkosFFT::Impl::is_complex_v, "ihfft: OutViewType must be complex"); auto new_norm = KokkosFFT::Impl::swap_direction(norm); @@ -585,9 +585,9 @@ void rfft2(const ExecutionSpace& exec_space, const InViewType& in, using in_value_type = typename InViewType::non_const_value_type; using out_value_type = typename OutViewType::non_const_value_type; - static_assert(std::is_floating_point::value, + static_assert(KokkosFFT::Impl::is_real_v, "rfft2: InViewType must be real"); - static_assert(KokkosFFT::Impl::is_complex::value, + static_assert(KokkosFFT::Impl::is_complex_v, "rfft2: OutViewType must be complex"); fft2(exec_space, in, out, norm, axes, s); @@ -635,9 +635,9 @@ void irfft2(const ExecutionSpace& exec_space, const InViewType& in, using in_value_type = typename InViewType::non_const_value_type; using out_value_type = typename OutViewType::non_const_value_type; - static_assert(KokkosFFT::Impl::is_complex::value, + static_assert(KokkosFFT::Impl::is_complex_v, "irfft2: InViewType must be complex"); - static_assert(std::is_floating_point::value, + static_assert(KokkosFFT::Impl::is_real_v, "irfft2: OutViewType must be real"); ifft2(exec_space, in, out, norm, axes, s); @@ -775,9 +775,9 @@ void rfftn(const ExecutionSpace& exec_space, const InViewType& in, using in_value_type = typename InViewType::non_const_value_type; using out_value_type = typename OutViewType::non_const_value_type; - static_assert(std::is_floating_point::value, + static_assert(KokkosFFT::Impl::is_real_v, "rfftn: InViewType must be real"); - static_assert(KokkosFFT::Impl::is_complex::value, + static_assert(KokkosFFT::Impl::is_complex_v, "rfftn: OutViewType must be complex"); fftn(exec_space, in, out, axes, norm, s); @@ -826,9 +826,9 @@ void irfftn(const ExecutionSpace& exec_space, const InViewType& in, using in_value_type = typename InViewType::non_const_value_type; using out_value_type = typename OutViewType::non_const_value_type; - static_assert(KokkosFFT::Impl::is_complex::value, + static_assert(KokkosFFT::Impl::is_complex_v, "irfftn: InViewType must be complex"); - static_assert(std::is_floating_point::value, + static_assert(KokkosFFT::Impl::is_real_v, "irfftn: OutViewType must be real"); ifftn(exec_space, in, out, axes, norm, s);