diff --git a/fft/src/KokkosFFT_Transform.hpp b/fft/src/KokkosFFT_Transform.hpp index b8923b15..27bb8006 100644 --- a/fft/src/KokkosFFT_Transform.hpp +++ b/fft/src/KokkosFFT_Transform.hpp @@ -474,11 +474,13 @@ void irfft2(const ExecutionSpace& exec_space, const InViewType& in, /// \param norm [in] How the normalization is applied (optional) /// \param s [in] Shape of the transformed axis of the output (optional) template -void fftn(const ExecutionSpace& exec_space, const InViewType& in, - OutViewType& out, axis_type axes, - KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward, - shape_type s = {0}) { + std::size_t DIM = InViewType::rank()> +void fftn( + const ExecutionSpace& exec_space, const InViewType& in, OutViewType& out, + axis_type axes = + KokkosFFT::Impl::index_sequence(DIM)>(), + KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward, + shape_type s = {}) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -507,11 +509,13 @@ void fftn(const ExecutionSpace& exec_space, const InViewType& in, /// \param norm [in] How the normalization is applied (optional) /// \param s [in] Shape of the transformed axis of the output (optional) template -void ifftn(const ExecutionSpace& exec_space, const InViewType& in, - OutViewType& out, axis_type axes, - KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward, - shape_type s = {0}) { + std::size_t DIM = InViewType::rank()> +void ifftn( + const ExecutionSpace& exec_space, const InViewType& in, OutViewType& out, + axis_type axes = + KokkosFFT::Impl::index_sequence(DIM)>(), + KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward, + shape_type s = {}) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -542,11 +546,13 @@ void ifftn(const ExecutionSpace& exec_space, const InViewType& in, /// \param norm [in] How the normalization is applied (optional) /// \param s [in] Shape of the transformed axis of the output (optional) template -void rfftn(const ExecutionSpace& exec_space, const InViewType& in, - OutViewType& out, axis_type axes, - KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward, - shape_type s = {0}) { + std::size_t DIM = InViewType::rank()> +void rfftn( + const ExecutionSpace& exec_space, const InViewType& in, OutViewType& out, + axis_type axes = + KokkosFFT::Impl::index_sequence(DIM)>(), + KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward, + shape_type s = {}) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -583,11 +589,13 @@ void rfftn(const ExecutionSpace& exec_space, const InViewType& in, /// \param norm [in] How the normalization is applied (optional) /// \param s [in] Shape of the transformed axis of the output (optional) template -void irfftn(const ExecutionSpace& exec_space, const InViewType& in, - OutViewType& out, axis_type axes, - KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward, - shape_type s = {0}) { + std::size_t DIM = InViewType::rank()> +void irfftn( + const ExecutionSpace& exec_space, const InViewType& in, OutViewType& out, + axis_type axes = + KokkosFFT::Impl::index_sequence(DIM)>(), + KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward, + shape_type s = {}) { static_assert( KokkosFFT::Impl::are_operatable_views_v, diff --git a/fft/unit_test/Test_Transform.cpp b/fft/unit_test/Test_Transform.cpp index 8ea4c09e..c34da843 100644 --- a/fft/unit_test/Test_Transform.cpp +++ b/fft/unit_test/Test_Transform.cpp @@ -2322,8 +2322,8 @@ void test_fftn_2dfft_2dview() { using axes_type = KokkosFFT::axis_type<2>; axes_type axes = {-2, -1}; - KokkosFFT::fftn(execution_space(), x, out, - axes); // default: KokkosFFT::Normalization::backward + KokkosFFT::fftn(execution_space(), x, + out); // default: KokkosFFT::Normalization::backward KokkosFFT::fftn(execution_space(), x, out_b, axes, KokkosFFT::Normalization::backward); KokkosFFT::fftn(execution_space(), x, out_o, axes, @@ -2387,8 +2387,8 @@ void test_ifftn_2dfft_2dview() { KokkosFFT::ifft(execution_space(), out1, out2, KokkosFFT::Normalization::backward, /*axis=*/0); - KokkosFFT::ifftn(execution_space(), x, out, - axes); // default: KokkosFFT::Normalization::backward + KokkosFFT::ifftn(execution_space(), x, + out); // default: KokkosFFT::Normalization::backward KokkosFFT::ifftn(execution_space(), x, out_b, axes, KokkosFFT::Normalization::backward); KokkosFFT::ifftn(execution_space(), x, out_o, axes, @@ -2452,8 +2452,8 @@ void test_rfftn_2dfft_2dview() { KokkosFFT::Normalization::backward, /*axis=*/0); Kokkos::deep_copy(x, x_ref); - KokkosFFT::rfftn(execution_space(), x, out, - axes); // default: KokkosFFT::Normalization::backward + KokkosFFT::rfftn(execution_space(), x, + out); // default: KokkosFFT::Normalization::backward Kokkos::deep_copy(x, x_ref); KokkosFFT::rfftn(execution_space(), x, out_b, axes, @@ -2531,8 +2531,8 @@ void test_irfftn_2dfft_2dview() { KokkosFFT::Normalization::backward, /*axis=*/1); Kokkos::deep_copy(x, x_ref); - KokkosFFT::irfftn(execution_space(), x, out, - axes); // default: KokkosFFT::Normalization::backward + KokkosFFT::irfftn(execution_space(), x, + out); // default: KokkosFFT::Normalization::backward Kokkos::deep_copy(x, x_ref); KokkosFFT::irfftn(execution_space(), x, out_b, axes, @@ -2698,8 +2698,8 @@ void test_fftn_3dfft_3dview(T atol = 1.0e-6) { KokkosFFT::fft(execution_space(), out2, out3, KokkosFFT::Normalization::backward, /*axis=*/0); - KokkosFFT::fftn(execution_space(), x, out, - axes); // default: KokkosFFT::Normalization::backward + KokkosFFT::fftn(execution_space(), x, + out); // default: KokkosFFT::Normalization::backward KokkosFFT::fftn(execution_space(), x, out_b, axes, KokkosFFT::Normalization::backward); KokkosFFT::fftn(execution_space(), x, out_o, axes, @@ -2746,8 +2746,8 @@ void test_ifftn_3dfft_3dview() { KokkosFFT::ifft(execution_space(), out2, out3, KokkosFFT::Normalization::backward, /*axis=*/0); - KokkosFFT::ifftn(execution_space(), x, out, - axes); // default: KokkosFFT::Normalization::backward + KokkosFFT::ifftn(execution_space(), x, + out); // default: KokkosFFT::Normalization::backward KokkosFFT::ifftn(execution_space(), x, out_b, axes, KokkosFFT::Normalization::backward); KokkosFFT::ifftn(execution_space(), x, out_o, axes, @@ -2796,8 +2796,8 @@ void test_rfftn_3dfft_3dview() { KokkosFFT::Normalization::backward, /*axis=*/0); Kokkos::deep_copy(x, x_ref); - KokkosFFT::rfftn(execution_space(), x, out, - axes); // default: KokkosFFT::Normalization::backward + KokkosFFT::rfftn(execution_space(), x, + out); // default: KokkosFFT::Normalization::backward Kokkos::deep_copy(x, x_ref); KokkosFFT::rfftn(execution_space(), x, out_b, axes, @@ -2853,8 +2853,8 @@ void test_irfftn_3dfft_3dview() { KokkosFFT::Normalization::backward, /*axis=*/2); Kokkos::deep_copy(x, x_ref); - KokkosFFT::irfftn(execution_space(), x, out, - axes); // default: KokkosFFT::Normalization::backward + KokkosFFT::irfftn(execution_space(), x, + out); // default: KokkosFFT::Normalization::backward Kokkos::deep_copy(x, x_ref); KokkosFFT::irfftn(execution_space(), x, out_b, axes,