diff --git a/docs/api/plan.rst b/docs/api/plan.rst index 89eb6c33..ce20c55f 100644 --- a/docs/api/plan.rst +++ b/docs/api/plan.rst @@ -2,8 +2,8 @@ .. .. SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception -KokkosFFT::Impl::Plan ---------------------- +KokkosFFT::Plan +--------------- -.. doxygenclass:: KokkosFFT::Impl::Plan +.. doxygenclass:: KokkosFFT::Plan :members: diff --git a/docs/api_reference.rst b/docs/api_reference.rst index 570c31e3..bbff8ef7 100644 --- a/docs/api_reference.rst +++ b/docs/api_reference.rst @@ -9,8 +9,8 @@ API Reference This section documents the public user interface of ``Kokkos-fft``. APIs are defined in ``KokkosFFT`` namespace and implementation details are defined in ``KokkosFFT::Impl`` namespace. -Thus, it is highly discouraged for users to access functions in ``KokkosFFT::Impl`` namespace except for ``Plan``. -Except for ``KokkosFFT::Impl::Plan``, there are corresponding functions in ``numpy.fft`` as shown below. +Thus, it is highly discouraged for users to access functions in ``KokkosFFT::Impl`` namespace. +Except for ``KokkosFFT::Plan``, there are corresponding functions in ``numpy.fft`` as shown below. FFT Plan -------- diff --git a/docs/intro/using.rst b/docs/intro/using.rst index 81fad685..5c9ebed3 100644 --- a/docs/intro/using.rst +++ b/docs/intro/using.rst @@ -122,8 +122,8 @@ The following listing shows examples with and without transpose operation. Reuse FFT plan -------------- -Apart from the basic APIs, Kokkos-fft APIs include overloaded APIs which can take a FFT plan as an argument. -Using these overloaded APIs, we can reuse the FFT plan created before. +Apart from the basic APIs, Kokkos-fft offers the capability to create a FFT plan wrapping the FFT plans of backend libraries. +We can reuse the FFT plan created once to perform FFTs multiple times on different data given that they have the same properties. In some backend, FFT plan creation leads to some overhead, wherein we need this functionality. (see :doc:`minimum working example<../samples/06_1DFFT_reuse_plans>`) diff --git a/examples/06_1DFFT_reuse_plans/06_1DFFT_reuse_plans.cpp b/examples/06_1DFFT_reuse_plans/06_1DFFT_reuse_plans.cpp index 3093ec2e..17f7f6a8 100644 --- a/examples/06_1DFFT_reuse_plans/06_1DFFT_reuse_plans.cpp +++ b/examples/06_1DFFT_reuse_plans/06_1DFFT_reuse_plans.cpp @@ -27,31 +27,31 @@ int main(int argc, char* argv[]) { Kokkos::fill_random(exec, xc2c, random_pool, z); int axis = -1; - KokkosFFT::Impl::Plan fft_plan(exec, xc2c, xc2c_hat, - KokkosFFT::Direction::forward, axis); - KokkosFFT::Impl::fft_exec_impl(fft_plan, xc2c, xc2c_hat); + KokkosFFT::Plan fft_plan(exec, xc2c, xc2c_hat, + KokkosFFT::Direction::forward, axis); + fft_plan.execute(xc2c, xc2c_hat); - KokkosFFT::Impl::Plan ifft_plan(exec, xc2c_hat, xc2c_inv, - KokkosFFT::Direction::backward, axis); - KokkosFFT::Impl::fft_exec_impl(ifft_plan, xc2c_hat, xc2c_inv); + KokkosFFT::Plan ifft_plan(exec, xc2c_hat, xc2c_inv, + KokkosFFT::Direction::backward, axis); + ifft_plan.execute(xc2c_hat, xc2c_inv); // 1D R2C FFT View1D xr2c("xr2c", n0); View1D > xr2c_hat("xr2c_hat", n0 / 2 + 1); Kokkos::fill_random(exec, xr2c, random_pool, 1); - KokkosFFT::Impl::Plan rfft_plan(exec, xr2c, xr2c_hat, - KokkosFFT::Direction::forward, axis); - KokkosFFT::Impl::fft_exec_impl(rfft_plan, xr2c, xr2c_hat); + KokkosFFT::Plan rfft_plan(exec, xr2c, xr2c_hat, + KokkosFFT::Direction::forward, axis); + rfft_plan.execute(xr2c, xr2c_hat); // 1D C2R FFT View1D > xc2r("xc2r_hat", n0 / 2 + 1); View1D xc2r_hat("xc2r", n0); Kokkos::fill_random(exec, xc2r, random_pool, z); - KokkosFFT::Impl::Plan irfft_plan(exec, xc2r, xc2r_hat, - KokkosFFT::Direction::backward, axis); - KokkosFFT::Impl::fft_exec_impl(irfft_plan, xc2r, xc2r_hat); + KokkosFFT::Plan irfft_plan(exec, xc2r, xc2r_hat, + KokkosFFT::Direction::backward, axis); + irfft_plan.execute(xc2r, xc2r_hat); exec.fence(); } Kokkos::finalize(); diff --git a/fft/src/KokkosFFT_Plans.hpp b/fft/src/KokkosFFT_Plans.hpp index 05758499..9ec5dae6 100644 --- a/fft/src/KokkosFFT_Plans.hpp +++ b/fft/src/KokkosFFT_Plans.hpp @@ -15,38 +15,48 @@ #include "KokkosFFT_default_types.hpp" #include "KokkosFFT_traits.hpp" #include "KokkosFFT_transpose.hpp" +#include "KokkosFFT_normalization.hpp" #include "KokkosFFT_padding.hpp" #include "KokkosFFT_utils.hpp" #if defined(KOKKOS_ENABLE_CUDA) #include "KokkosFFT_Cuda_plans.hpp" +#include "KokkosFFT_Cuda_transform.hpp" #ifdef ENABLE_HOST_AND_DEVICE #include "KokkosFFT_Host_plans.hpp" +#include "KokkosFFT_Host_transform.hpp" #endif #elif defined(KOKKOS_ENABLE_HIP) #if defined(KOKKOSFFT_ENABLE_TPL_ROCFFT) #include "KokkosFFT_ROCM_plans.hpp" +#include "KokkosFFT_ROCM_transform.hpp" #else #include "KokkosFFT_HIP_plans.hpp" +#include "KokkosFFT_HIP_transform.hpp" #endif #ifdef ENABLE_HOST_AND_DEVICE #include "KokkosFFT_Host_plans.hpp" +#include "KokkosFFT_Host_transform.hpp" #endif #elif defined(KOKKOS_ENABLE_SYCL) #include "KokkosFFT_SYCL_plans.hpp" +#include "KokkosFFT_SYCL_transform.hpp" #ifdef ENABLE_HOST_AND_DEVICE #include "KokkosFFT_Host_plans.hpp" +#include "KokkosFFT_Host_transform.hpp" #endif #elif defined(KOKKOS_ENABLE_OPENMP) #include "KokkosFFT_Host_plans.hpp" +#include "KokkosFFT_Host_transform.hpp" #elif defined(KOKKOS_ENABLE_THREADS) #include "KokkosFFT_Host_plans.hpp" +#include "KokkosFFT_Host_transform.hpp" #else #include "KokkosFFT_Host_plans.hpp" +#include "KokkosFFT_Host_transform.hpp" #endif namespace KokkosFFT { -namespace Impl { /// \brief A class that manages a FFT plan of backend FFT library. /// /// This class is used to manage the FFT plan of backend FFT library. @@ -57,7 +67,7 @@ namespace Impl { template class Plan { - public: + private: //! The type of Kokkos execution pace using execSpace = ExecutionSpace; @@ -87,12 +97,6 @@ class Plan { //! The type of map for transpose using map_type = axis_type; - //! The non-const View type of input view - using nonConstInViewType = std::remove_cv_t; - - //! The non-const View type of output view - using nonConstOutViewType = std::remove_cv_t; - //! Naive 1D View for work buffer using BufferViewType = Kokkos::View*, layout_type, execSpace>; @@ -136,12 +140,6 @@ class Plan { extents_type m_in_extents, m_out_extents; ///@} - //! @{ - //! Internal buffers used for transpose - nonConstInViewType m_in_T; - nonConstOutViewType m_out_T; - //! @} - //! Internal work buffer (for rocfft) BufferViewType m_buffer; @@ -156,9 +154,9 @@ class Plan { /// \param n [in] Length of the transformed axis of the output (default, /// nullopt) // - explicit Plan(const ExecutionSpace& exec_space, InViewType& in, - OutViewType& out, KokkosFFT::Direction direction, int axis, - std::optional n = std::nullopt) + explicit Plan(const ExecutionSpace& exec_space, const InViewType& in, + const OutViewType& out, KokkosFFT::Direction direction, + int axis, std::optional n = std::nullopt) : m_exec_space(exec_space), m_axes({axis}), m_direction(direction) { static_assert(KokkosFFT::Impl::is_AllowedSpace_v, "Plan::Plan: ExecutionSpace is not allowed "); @@ -214,8 +212,8 @@ class Plan { /// \param axes [in] Axes over which FFT is performed /// \param s [in] Shape of the transformed axis of the output (default, {}) // - explicit Plan(const ExecutionSpace& exec_space, InViewType& in, - OutViewType& out, KokkosFFT::Direction direction, + explicit Plan(const ExecutionSpace& exec_space, const InViewType& in, + const OutViewType& out, KokkosFFT::Direction direction, axis_type axes, shape_type s = {}) : m_exec_space(exec_space), m_axes(axes), m_direction(direction) { static_assert(KokkosFFT::Impl::is_AllowedSpace_v, @@ -261,8 +259,8 @@ class Plan { } ~Plan() { - destroy_plan_and_info(m_plan, - m_info); + KokkosFFT::Impl::destroy_plan_and_info(m_plan, m_info); } Plan() = delete; @@ -271,23 +269,84 @@ class Plan { Plan& operator=(Plan&&) = delete; Plan(Plan&&) = delete; + /// \brief Execute FFT on input and output Views with normalization + /// + /// \param in [in] Input data + /// \param out [out] Ouput data + /// \param norm [in] How the normalization is applied (default, backward) + void execute(const InViewType& in, const OutViewType& out, + KokkosFFT::Normalization norm = + KokkosFFT::Normalization::backward) const { + static_assert( + KokkosFFT::Impl::are_operatable_views_v, + "Plan::execute: InViewType and OutViewType must have the same base " + "floating point " + "type (float/double), the same layout (LayoutLeft/LayoutRight), and " + "the " + "same rank. ExecutionSpace must be accessible to the data in " + "InViewType " + "and OutViewType."); + + // sanity check that the plan is consistent with the input/output views + good(in, out); + + using ManagableInViewType = + typename KokkosFFT::Impl::manageable_view_type::type; + using ManagableOutViewType = + typename KokkosFFT::Impl::manageable_view_type::type; + ManagableInViewType in_s; + InViewType in_tmp; + if (m_is_crop_or_pad_needed) { + KokkosFFT::Impl::crop_or_pad(m_exec_space, in, in_s, m_shape); + in_tmp = in_s; + } else { + in_tmp = in; + } + + if (m_is_transpose_needed) { + using LayoutType = typename ManagableInViewType::array_layout; + ManagableInViewType const in_T( + "in_T", + KokkosFFT::Impl::create_layout( + KokkosFFT::Impl::compute_transpose_extents(in_tmp, m_map))); + ManagableOutViewType const out_T( + "out_T", KokkosFFT::Impl::create_layout( + KokkosFFT::Impl::compute_transpose_extents(out, m_map))); + + KokkosFFT::Impl::transpose(m_exec_space, in_tmp, in_T, m_map); + KokkosFFT::Impl::transpose(m_exec_space, out, out_T, m_map); + + execute_fft(in_T, out_T, norm); + + KokkosFFT::Impl::transpose(m_exec_space, out_T, out, m_map_inv); + } else { + execute_fft(in_tmp, out, norm); + } + } + + private: + void execute_fft(const InViewType& in, const OutViewType& out, + KokkosFFT::Normalization norm) const { + auto* idata = reinterpret_cast::type*>(in.data()); + auto* odata = reinterpret_cast::type*>(out.data()); + + auto const direction = + KokkosFFT::Impl::direction_type(m_direction); + KokkosFFT::Impl::exec_plan(*m_plan, idata, odata, direction, m_info); + KokkosFFT::Impl::normalize(m_exec_space, out, m_direction, norm, + m_fft_size); + } + /// \brief Sanity check of the plan used to call FFT interface with /// pre-defined FFT plan. This raises an error if there is an /// incosistency between FFT function and plan /// /// \param in [in] Input data /// \param out [in] Ouput data - template - void good(const InViewType2& in, const OutViewType2& out) const { - using nonConstInViewType2 = std::remove_cv_t; - using nonConstOutViewType2 = std::remove_cv_t; - static_assert(std::is_same_v, - "Plan::good: InViewType for plan and execution " - "are not identical."); - static_assert(std::is_same_v, - "Plan::good: OutViewType for plan and " - "execution are not identical."); - + void good(const InViewType& in, const OutViewType& out) const { auto in_extents = KokkosFFT::Impl::extract_extents(in); auto out_extents = KokkosFFT::Impl::extract_extents(out); @@ -299,26 +358,7 @@ class Plan { out_extents != m_out_extents, "extents of output View for plan and execution are not identical."); } - - /// \brief Return the execution space - execSpace const& exec_space() const noexcept { return m_exec_space; } - - /// \brief Return the FFT plan - fft_plan_type& plan() const { return *m_plan; } - - /// \brief Return the FFT info - fft_info_type const& info() const { return m_info; } - - /// \brief Return the FFT size - fft_size_type fft_size() const { return m_fft_size; } - KokkosFFT::Direction direction() const { return m_direction; } - bool is_transpose_needed() const { return m_is_transpose_needed; } - bool is_crop_or_pad_needed() const { return m_is_crop_or_pad_needed; } - extents_type shape() const { return m_shape; } - map_type map() const { return m_map; } - map_type map_inv() const { return m_map_inv; } }; -} // namespace Impl } // namespace KokkosFFT #endif diff --git a/fft/src/KokkosFFT_Transform.hpp b/fft/src/KokkosFFT_Transform.hpp index 7a2a1350..a9bdce7d 100644 --- a/fft/src/KokkosFFT_Transform.hpp +++ b/fft/src/KokkosFFT_Transform.hpp @@ -6,122 +6,11 @@ #define KOKKOSFFT_TRANSFORM_HPP #include -#include "KokkosFFT_default_types.hpp" #include "KokkosFFT_traits.hpp" -#include "KokkosFFT_utils.hpp" #include "KokkosFFT_normalization.hpp" -#include "KokkosFFT_transpose.hpp" -#include "KokkosFFT_padding.hpp" +#include "KokkosFFT_utils.hpp" #include "KokkosFFT_Plans.hpp" -#if defined(KOKKOS_ENABLE_CUDA) -#include "KokkosFFT_Cuda_transform.hpp" -#ifdef ENABLE_HOST_AND_DEVICE -#include "KokkosFFT_Host_transform.hpp" -#endif -#elif defined(KOKKOS_ENABLE_HIP) -#if defined(KOKKOSFFT_ENABLE_TPL_ROCFFT) -#include "KokkosFFT_ROCM_transform.hpp" -#else -#include "KokkosFFT_HIP_transform.hpp" -#endif -#ifdef ENABLE_HOST_AND_DEVICE -#include "KokkosFFT_Host_transform.hpp" -#endif -#elif defined(KOKKOS_ENABLE_SYCL) -#include "KokkosFFT_SYCL_transform.hpp" -#ifdef ENABLE_HOST_AND_DEVICE -#include "KokkosFFT_Host_transform.hpp" -#endif -#elif defined(KOKKOS_ENABLE_OPENMP) -#include "KokkosFFT_Host_transform.hpp" -#elif defined(KOKKOS_ENABLE_THREADS) -#include "KokkosFFT_Host_transform.hpp" -#else -#include "KokkosFFT_Host_transform.hpp" -#endif - -#include - -// General Transform Interface -namespace KokkosFFT { -namespace Impl { - -template -void exec_impl( - const PlanType& plan, const InViewType& in, OutViewType& out, - KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward) { - using in_value_type = typename InViewType::non_const_value_type; - using out_value_type = typename OutViewType::non_const_value_type; - using ExecutionSpace = typename PlanType::execSpace; - - auto* idata = reinterpret_cast::type*>(in.data()); - auto* odata = reinterpret_cast::type*>(out.data()); - - auto const exec_space = plan.exec_space(); - auto const direction = direction_type(plan.direction()); - KokkosFFT::Impl::exec_plan(plan.plan(), idata, odata, direction, plan.info()); - KokkosFFT::Impl::normalize(exec_space, out, plan.direction(), norm, - plan.fft_size()); -} - -template -void fft_exec_impl( - const PlanType& plan, const InViewType& in, OutViewType& out, - KokkosFFT::Normalization norm = KokkosFFT::Normalization::backward) { - using ExecutionSpace = typename PlanType::execSpace; - static_assert( - KokkosFFT::Impl::are_operatable_views_v, - "fft_exec_impl: InViewType and OutViewType must have the same base " - "floating point " - "type (float/double), the same layout (LayoutLeft/LayoutRight), and the " - "same rank. ExecutionSpace must be accessible to the data in InViewType " - "and OutViewType."); - - plan.template good(in, out); - - const auto exec_space = plan.exec_space(); - using ManagableInViewType = - typename KokkosFFT::Impl::manageable_view_type::type; - using ManagableOutViewType = - typename KokkosFFT::Impl::manageable_view_type::type; - ManagableInViewType _in_s; - InViewType _in; - if (plan.is_crop_or_pad_needed()) { - auto new_shape = plan.shape(); - KokkosFFT::Impl::crop_or_pad(exec_space, in, _in_s, new_shape); - _in = _in_s; - } else { - _in = in; - } - - if (plan.is_transpose_needed()) { - using LayoutType = typename ManagableInViewType::array_layout; - ManagableInViewType const in_T( - "in_T", - create_layout(compute_transpose_extents(_in, plan.map()))); - ManagableOutViewType const out_T( - "out_T", - create_layout(compute_transpose_extents(out, plan.map()))); - - KokkosFFT::Impl::transpose(exec_space, _in, in_T, plan.map()); - KokkosFFT::Impl::transpose(exec_space, out, out_T, plan.map()); - - KokkosFFT::Impl::exec_impl(plan, in_T, out_T, norm); - - KokkosFFT::Impl::transpose(exec_space, out_T, out, plan.map_inv()); - - } else { - KokkosFFT::Impl::exec_impl(plan, _in, out, norm); - } -} - -} // namespace Impl -} // namespace KokkosFFT - namespace KokkosFFT { /// \brief One dimensional FFT in forward direction /// @@ -148,9 +37,9 @@ void fft(const ExecutionSpace& exec_space, const InViewType& in, "fft: View rank must be larger than or equal to 1"); KOKKOSFFT_THROW_IF(!KokkosFFT::Impl::are_valid_axes(in, axis_type<1>({axis})), "axes are invalid for in/out views"); - KokkosFFT::Impl::Plan plan(exec_space, in, out, KokkosFFT::Direction::forward, - axis, n); - KokkosFFT::Impl::fft_exec_impl(plan, in, out, norm); + KokkosFFT::Plan plan(exec_space, in, out, KokkosFFT::Direction::forward, axis, + n); + plan.execute(in, out, norm); } /// \brief One dimensional FFT in backward direction @@ -178,9 +67,9 @@ void ifft(const ExecutionSpace& exec_space, const InViewType& in, "ifft: View rank must be larger than or equal to 1"); KOKKOSFFT_THROW_IF(!KokkosFFT::Impl::are_valid_axes(in, axis_type<1>({axis})), "axes are invalid for in/out views"); - KokkosFFT::Impl::Plan plan(exec_space, in, out, - KokkosFFT::Direction::backward, axis, n); - KokkosFFT::Impl::fft_exec_impl(plan, in, out, norm); + KokkosFFT::Plan plan(exec_space, in, out, KokkosFFT::Direction::backward, + axis, n); + plan.execute(in, out, norm); } /// \brief One dimensional FFT for real input @@ -366,9 +255,9 @@ void fft2(const ExecutionSpace& exec_space, const InViewType& in, "fft2: View rank must be larger than or equal to 2"); KOKKOSFFT_THROW_IF(!KokkosFFT::Impl::are_valid_axes(in, axes), "axes are invalid for in/out views"); - KokkosFFT::Impl::Plan plan(exec_space, in, out, KokkosFFT::Direction::forward, - axes, s); - KokkosFFT::Impl::fft_exec_impl(plan, in, out, norm); + KokkosFFT::Plan plan(exec_space, in, out, KokkosFFT::Direction::forward, axes, + s); + plan.execute(in, out, norm); } /// \brief Two dimensional FFT in backward direction @@ -396,9 +285,9 @@ void ifft2(const ExecutionSpace& exec_space, const InViewType& in, "ifft2: View rank must be larger than or equal to 2"); KOKKOSFFT_THROW_IF(!KokkosFFT::Impl::are_valid_axes(in, axes), "axes are invalid for in/out views"); - KokkosFFT::Impl::Plan plan(exec_space, in, out, - KokkosFFT::Direction::backward, axes, s); - KokkosFFT::Impl::fft_exec_impl(plan, in, out, norm); + KokkosFFT::Plan plan(exec_space, in, out, KokkosFFT::Direction::backward, + axes, s); + plan.execute(in, out, norm); } /// \brief Two dimensional FFT for real input @@ -511,9 +400,9 @@ void fftn( "fftn: View rank must be larger than or equal to the Rank of FFT axes"); KOKKOSFFT_THROW_IF(!KokkosFFT::Impl::are_valid_axes(in, axes), "axes are invalid for in/out views"); - KokkosFFT::Impl::Plan plan(exec_space, in, out, KokkosFFT::Direction::forward, - axes, s); - KokkosFFT::Impl::fft_exec_impl(plan, in, out, norm); + KokkosFFT::Plan plan(exec_space, in, out, KokkosFFT::Direction::forward, axes, + s); + plan.execute(in, out, norm); } /// \brief N-dimensional FFT in backward direction with a given plan @@ -554,9 +443,9 @@ void ifftn( "ifftn: View rank must be larger than or equal to the Rank of FFT axes"); KOKKOSFFT_THROW_IF(!KokkosFFT::Impl::are_valid_axes(in, axes), "axes are invalid for in/out views"); - KokkosFFT::Impl::Plan plan(exec_space, in, out, - KokkosFFT::Direction::backward, axes, s); - KokkosFFT::Impl::fft_exec_impl(plan, in, out, norm); + KokkosFFT::Plan plan(exec_space, in, out, KokkosFFT::Direction::backward, + axes, s); + plan.execute(in, out, norm); } /// \brief N-dimensional FFT for real input diff --git a/fft/unit_test/Test_Plans.cpp b/fft/unit_test/Test_Plans.cpp index 8928ddb7..741c0bdb 100644 --- a/fft/unit_test/Test_Plans.cpp +++ b/fft/unit_test/Test_Plans.cpp @@ -85,7 +85,7 @@ void test_plan_constructible() { using ComplexView1DType = Kokkos::View*, ExecutionSpace>; using PlanType = - KokkosFFT::Impl::Plan; + KokkosFFT::Plan; #if !defined(ENABLE_HOST_AND_DEVICE) && \ (defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP) || \ @@ -132,59 +132,59 @@ void test_plan_1dfft_1dview() { ComplexView1DType x_cin("x_cin", n), x_cout("x_cout", n); // R2C plan - KokkosFFT::Impl::Plan plan_r2c_axis_0(execution_space(), x, x_c, - KokkosFFT::Direction::forward, - /*axis=*/0); - KokkosFFT::Impl::Plan plan_r2c_axes_0(execution_space(), x, x_c, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<1>({0})); + KokkosFFT::Plan plan_r2c_axis_0(execution_space(), x, x_c, + KokkosFFT::Direction::forward, + /*axis=*/0); + KokkosFFT::Plan plan_r2c_axes_0(execution_space(), x, x_c, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<1>({0})); // C2R plan - KokkosFFT::Impl::Plan plan_c2r_axis0(execution_space(), x_c, x, - KokkosFFT::Direction::backward, - /*axis=*/0); - KokkosFFT::Impl::Plan plan_c2r_axes0(execution_space(), x_c, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<1>({0})); + KokkosFFT::Plan plan_c2r_axis0(execution_space(), x_c, x, + KokkosFFT::Direction::backward, + /*axis=*/0); + KokkosFFT::Plan plan_c2r_axes0(execution_space(), x_c, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<1>({0})); // C2C plan - KokkosFFT::Impl::Plan plan_c2c_f_axis0(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axis=*/0); - KokkosFFT::Impl::Plan plan_c2c_f_axes0(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<1>({0})); + KokkosFFT::Plan plan_c2c_f_axis0(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axis=*/0); + KokkosFFT::Plan plan_c2c_f_axes0(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<1>({0})); // Check if errors are correctly raised aginst wrong dirction // Input Real, Output Complex -> must be forward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axis0( - execution_space(), x, x_c, KokkosFFT::Direction::backward, - /*axis=*/0); + KokkosFFT::Plan wrong_plan_r2c_axis0(execution_space(), x, x_c, + KokkosFFT::Direction::backward, + /*axis=*/0); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes0( - execution_space(), x, x_c, KokkosFFT::Direction::backward, - /*axes=*/axes_type<1>({0})); + KokkosFFT::Plan wrong_plan_r2c_axes0(execution_space(), x, x_c, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<1>({0})); }, std::runtime_error); // Input Complex, Output Real -> must be backward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axis0( - execution_space(), x_c, x, KokkosFFT::Direction::forward, - /*axis=*/0); + KokkosFFT::Plan wrong_plan_c2r_axis0(execution_space(), x_c, x, + KokkosFFT::Direction::forward, + /*axis=*/0); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes0( - execution_space(), x_c, x, KokkosFFT::Direction::forward, - /*axes=*/axes_type<1>({0})); + KokkosFFT::Plan wrong_plan_c2r_axes0(execution_space(), x_c, x, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<1>({0})); }, std::runtime_error); } @@ -201,54 +201,54 @@ void test_plan_1dfft_2dview() { ComplexView2DType x_cin("x_cin", n0, n1), x_cout("x_cout", n0, n1); // R2C plan - KokkosFFT::Impl::Plan plan_r2c_axis_0(execution_space(), x, x_c_axis_0, - KokkosFFT::Direction::forward, - /*axis=*/0); - KokkosFFT::Impl::Plan plan_r2c_axis_1(execution_space(), x, x_c_axis_1, - KokkosFFT::Direction::forward, - /*axis=*/1); - KokkosFFT::Impl::Plan plan_r2c_axis_minus1(execution_space(), x, x_c_axis_1, - KokkosFFT::Direction::forward, - /*axis=*/-1); + KokkosFFT::Plan plan_r2c_axis_0(execution_space(), x, x_c_axis_0, + KokkosFFT::Direction::forward, + /*axis=*/0); + KokkosFFT::Plan plan_r2c_axis_1(execution_space(), x, x_c_axis_1, + KokkosFFT::Direction::forward, + /*axis=*/1); + KokkosFFT::Plan plan_r2c_axis_minus1(execution_space(), x, x_c_axis_1, + KokkosFFT::Direction::forward, + /*axis=*/-1); // C2R plan - KokkosFFT::Impl::Plan plan_c2r_axis_0(execution_space(), x_c_axis_0, x, - KokkosFFT::Direction::backward, - /*axis=*/0); - KokkosFFT::Impl::Plan plan_c2r_axis_1(execution_space(), x_c_axis_1, x, - KokkosFFT::Direction::backward, - /*axis=*/1); - KokkosFFT::Impl::Plan plan_c2r_axis_minus1(execution_space(), x_c_axis_1, x, - KokkosFFT::Direction::backward, - /*axis=*/-1); + KokkosFFT::Plan plan_c2r_axis_0(execution_space(), x_c_axis_0, x, + KokkosFFT::Direction::backward, + /*axis=*/0); + KokkosFFT::Plan plan_c2r_axis_1(execution_space(), x_c_axis_1, x, + KokkosFFT::Direction::backward, + /*axis=*/1); + KokkosFFT::Plan plan_c2r_axis_minus1(execution_space(), x_c_axis_1, x, + KokkosFFT::Direction::backward, + /*axis=*/-1); // C2C plan - KokkosFFT::Impl::Plan plan_c2c_f_axis_0(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axis=*/0); - KokkosFFT::Impl::Plan plan_c2c_f_axis_1(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axis=*/1); + KokkosFFT::Plan plan_c2c_f_axis_0(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axis=*/0); + KokkosFFT::Plan plan_c2c_f_axis_1(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axis=*/1); // Check if errors are correctly raised aginst wrong dirction // Input Real, Output Complex -> must be forward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axis_0( - execution_space(), x, x_c_axis_0, KokkosFFT::Direction::backward, - /*axis=*/0); + KokkosFFT::Plan wrong_plan_r2c_axis_0(execution_space(), x, x_c_axis_0, + KokkosFFT::Direction::backward, + /*axis=*/0); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axis_1( - execution_space(), x, x_c_axis_1, KokkosFFT::Direction::backward, - /*axis=*/1); + KokkosFFT::Plan wrong_plan_r2c_axis_1(execution_space(), x, x_c_axis_1, + KokkosFFT::Direction::backward, + /*axis=*/1); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axis_minus1( + KokkosFFT::Plan wrong_plan_r2c_axis_minus1( execution_space(), x, x_c_axis_1, KokkosFFT::Direction::backward, /*axis=*/-1); }, @@ -257,21 +257,21 @@ void test_plan_1dfft_2dview() { // Input Complex, Output Real -> must be backward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axis_0( - execution_space(), x_c_axis_0, x, KokkosFFT::Direction::forward, - /*axis=*/0); + KokkosFFT::Plan wrong_plan_c2r_axis_0(execution_space(), x_c_axis_0, x, + KokkosFFT::Direction::forward, + /*axis=*/0); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axis_1( - execution_space(), x_c_axis_1, x, KokkosFFT::Direction::forward, - /*axis=*/1); + KokkosFFT::Plan wrong_plan_c2r_axis_1(execution_space(), x_c_axis_1, x, + KokkosFFT::Direction::forward, + /*axis=*/1); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axis_minus1( + KokkosFFT::Plan wrong_plan_c2r_axis_minus1( execution_space(), x_c_axis_1, x, KokkosFFT::Direction::forward, /*axis=*/-1); }, @@ -292,93 +292,93 @@ void test_plan_1dfft_3dview() { ComplexView3DType x_cin("x_cin", n0, n1, n2), x_cout("x_cout", n0, n1, n2); // R2C plan - KokkosFFT::Impl::Plan plan_r2c_axis_0(execution_space(), x, x_c_axis_0, - KokkosFFT::Direction::forward, - /*axis=*/0); - KokkosFFT::Impl::Plan plan_r2c_axis_1(execution_space(), x, x_c_axis_1, - KokkosFFT::Direction::forward, - /*axis=*/1); - KokkosFFT::Impl::Plan plan_r2c_axis_2(execution_space(), x, x_c_axis_2, - KokkosFFT::Direction::forward, - /*axis=*/2); + KokkosFFT::Plan plan_r2c_axis_0(execution_space(), x, x_c_axis_0, + KokkosFFT::Direction::forward, + /*axis=*/0); + KokkosFFT::Plan plan_r2c_axis_1(execution_space(), x, x_c_axis_1, + KokkosFFT::Direction::forward, + /*axis=*/1); + KokkosFFT::Plan plan_r2c_axis_2(execution_space(), x, x_c_axis_2, + KokkosFFT::Direction::forward, + /*axis=*/2); // C2R plan - KokkosFFT::Impl::Plan plan_c2r_axis_0(execution_space(), x_c_axis_0, x, - KokkosFFT::Direction::backward, - /*axis=*/0); - KokkosFFT::Impl::Plan plan_c2r_axis_1(execution_space(), x_c_axis_1, x, - KokkosFFT::Direction::backward, - /*axis=*/1); - KokkosFFT::Impl::Plan plan_c2r_axis_2(execution_space(), x_c_axis_2, x, - KokkosFFT::Direction::backward, - /*axis=*/2); + KokkosFFT::Plan plan_c2r_axis_0(execution_space(), x_c_axis_0, x, + KokkosFFT::Direction::backward, + /*axis=*/0); + KokkosFFT::Plan plan_c2r_axis_1(execution_space(), x_c_axis_1, x, + KokkosFFT::Direction::backward, + /*axis=*/1); + KokkosFFT::Plan plan_c2r_axis_2(execution_space(), x_c_axis_2, x, + KokkosFFT::Direction::backward, + /*axis=*/2); // C2C plan - KokkosFFT::Impl::Plan plan_c2c_f_axis_0(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axis=*/0); - KokkosFFT::Impl::Plan plan_c2c_f_axis_1(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axis=*/1); - KokkosFFT::Impl::Plan plan_c2c_f_axis_2(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axis=*/2); - KokkosFFT::Impl::Plan plan_c2c_b_axis_0(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::backward, - /*axis=*/0); - KokkosFFT::Impl::Plan plan_c2c_b_axis_1(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::backward, - /*axis=*/1); - KokkosFFT::Impl::Plan plan_c2c_b_axis_2(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::backward, - /*axis=*/2); + KokkosFFT::Plan plan_c2c_f_axis_0(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axis=*/0); + KokkosFFT::Plan plan_c2c_f_axis_1(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axis=*/1); + KokkosFFT::Plan plan_c2c_f_axis_2(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axis=*/2); + KokkosFFT::Plan plan_c2c_b_axis_0(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::backward, + /*axis=*/0); + KokkosFFT::Plan plan_c2c_b_axis_1(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::backward, + /*axis=*/1); + KokkosFFT::Plan plan_c2c_b_axis_2(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::backward, + /*axis=*/2); // Check if errors are correctly raised aginst wrong dirction // Input Real, Output Complex -> must be forward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axis_0( - execution_space(), x, x_c_axis_0, KokkosFFT::Direction::backward, - /*axis=*/0); + KokkosFFT::Plan wrong_plan_r2c_axis_0(execution_space(), x, x_c_axis_0, + KokkosFFT::Direction::backward, + /*axis=*/0); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axis_1( - execution_space(), x, x_c_axis_1, KokkosFFT::Direction::backward, - /*axis=*/1); + KokkosFFT::Plan wrong_plan_r2c_axis_1(execution_space(), x, x_c_axis_1, + KokkosFFT::Direction::backward, + /*axis=*/1); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axis_2( - execution_space(), x, x_c_axis_2, KokkosFFT::Direction::backward, - /*axis=*/2); + KokkosFFT::Plan wrong_plan_r2c_axis_2(execution_space(), x, x_c_axis_2, + KokkosFFT::Direction::backward, + /*axis=*/2); }, std::runtime_error); // Input Complex, Output Real -> must be backward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axis_0( - execution_space(), x_c_axis_0, x, KokkosFFT::Direction::forward, - /*axis=*/0); + KokkosFFT::Plan wrong_plan_c2r_axis_0(execution_space(), x_c_axis_0, x, + KokkosFFT::Direction::forward, + /*axis=*/0); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axis_1( - execution_space(), x_c_axis_1, x, KokkosFFT::Direction::forward, - /*axis=*/1); + KokkosFFT::Plan wrong_plan_c2r_axis_1(execution_space(), x_c_axis_1, x, + KokkosFFT::Direction::forward, + /*axis=*/1); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axis_2( - execution_space(), x_c_axis_2, x, KokkosFFT::Direction::forward, - /*axis=*/2); + KokkosFFT::Plan wrong_plan_c2r_axis_2(execution_space(), x_c_axis_2, x, + KokkosFFT::Direction::forward, + /*axis=*/2); }, std::runtime_error); } @@ -420,41 +420,41 @@ void test_plan_2dfft_2dview() { ComplexView2DType x_cin("x_cin", n0, n1), x_cout("x_cout", n0, n1); // R2C plan - KokkosFFT::Impl::Plan plan_r2c_axes_0_1(execution_space(), x, x_c_axis_1, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({0, 1})); - KokkosFFT::Impl::Plan plan_r2c_axes_1_0(execution_space(), x, x_c_axis_0, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({1, 0})); + KokkosFFT::Plan plan_r2c_axes_0_1(execution_space(), x, x_c_axis_1, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({0, 1})); + KokkosFFT::Plan plan_r2c_axes_1_0(execution_space(), x, x_c_axis_0, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({1, 0})); // C2R plan - KokkosFFT::Impl::Plan plan_c2r_axes_0_1(execution_space(), x_c_axis_1, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<2>({0, 1})); - KokkosFFT::Impl::Plan plan_c2r_axes_1_0(execution_space(), x_c_axis_0, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<2>({1, 0})); + KokkosFFT::Plan plan_c2r_axes_0_1(execution_space(), x_c_axis_1, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<2>({0, 1})); + KokkosFFT::Plan plan_c2r_axes_1_0(execution_space(), x_c_axis_0, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<2>({1, 0})); // C2C plan - KokkosFFT::Impl::Plan plan_c2c_f_axes_0_1(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({0, 1})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_1_0(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({1, 0})); + KokkosFFT::Plan plan_c2c_f_axes_0_1(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({0, 1})); + KokkosFFT::Plan plan_c2c_f_axes_1_0(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({1, 0})); // Check if errors are correctly raised aginst wrong dirction // Input Real, Output Complex -> must be forward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_0_1( + KokkosFFT::Plan wrong_plan_r2c_axes_0_1( execution_space(), x, x_c_axis_1, KokkosFFT::Direction::backward, /*axes=*/axes_type<2>({0, 1})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_1_0( + KokkosFFT::Plan wrong_plan_r2c_axes_1_0( execution_space(), x, x_c_axis_0, KokkosFFT::Direction::backward, /*axes=*/axes_type<2>({1, 0})); }, @@ -463,14 +463,14 @@ void test_plan_2dfft_2dview() { // Input Complex, Output Real -> must be backward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_0_1( + KokkosFFT::Plan wrong_plan_c2r_axes_0_1( execution_space(), x_c_axis_1, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<2>({0, 1})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_1_0( + KokkosFFT::Plan wrong_plan_c2r_axes_1_0( execution_space(), x_c_axis_0, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<2>({1, 0})); }, @@ -491,105 +491,105 @@ void test_plan_2dfft_3dview() { ComplexView3DType x_cin("x_cin", n0, n1, n2), x_cout("x_cout", n0, n1, n2); // R2C plan - KokkosFFT::Impl::Plan plan_r2c_axes_0_1(execution_space(), x, x_c_axis_1, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({0, 1})); - KokkosFFT::Impl::Plan plan_r2c_axes_0_2(execution_space(), x, x_c_axis_2, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({0, 2})); - KokkosFFT::Impl::Plan plan_r2c_axes_1_0(execution_space(), x, x_c_axis_0, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({1, 0})); - KokkosFFT::Impl::Plan plan_r2c_axes_1_2(execution_space(), x, x_c_axis_2, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({1, 2})); - KokkosFFT::Impl::Plan plan_r2c_axes_2_0(execution_space(), x, x_c_axis_0, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({2, 0})); - KokkosFFT::Impl::Plan plan_r2c_axes_2_1(execution_space(), x, x_c_axis_1, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({2, 1})); + KokkosFFT::Plan plan_r2c_axes_0_1(execution_space(), x, x_c_axis_1, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({0, 1})); + KokkosFFT::Plan plan_r2c_axes_0_2(execution_space(), x, x_c_axis_2, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({0, 2})); + KokkosFFT::Plan plan_r2c_axes_1_0(execution_space(), x, x_c_axis_0, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({1, 0})); + KokkosFFT::Plan plan_r2c_axes_1_2(execution_space(), x, x_c_axis_2, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({1, 2})); + KokkosFFT::Plan plan_r2c_axes_2_0(execution_space(), x, x_c_axis_0, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({2, 0})); + KokkosFFT::Plan plan_r2c_axes_2_1(execution_space(), x, x_c_axis_1, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({2, 1})); // C2R plan - KokkosFFT::Impl::Plan plan_c2r_axes_0_1(execution_space(), x_c_axis_1, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<2>({0, 1})); - KokkosFFT::Impl::Plan plan_c2r_axes_0_2(execution_space(), x_c_axis_2, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<2>({0, 2})); - KokkosFFT::Impl::Plan plan_c2r_axes_1_0(execution_space(), x_c_axis_0, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<2>({1, 0})); - KokkosFFT::Impl::Plan plan_c2r_axes_1_2(execution_space(), x_c_axis_2, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<2>({1, 2})); - KokkosFFT::Impl::Plan plan_c2r_axes_2_0(execution_space(), x_c_axis_0, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<2>({2, 0})); - KokkosFFT::Impl::Plan plan_c2r_axes_2_1(execution_space(), x_c_axis_1, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<2>({2, 1})); + KokkosFFT::Plan plan_c2r_axes_0_1(execution_space(), x_c_axis_1, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<2>({0, 1})); + KokkosFFT::Plan plan_c2r_axes_0_2(execution_space(), x_c_axis_2, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<2>({0, 2})); + KokkosFFT::Plan plan_c2r_axes_1_0(execution_space(), x_c_axis_0, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<2>({1, 0})); + KokkosFFT::Plan plan_c2r_axes_1_2(execution_space(), x_c_axis_2, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<2>({1, 2})); + KokkosFFT::Plan plan_c2r_axes_2_0(execution_space(), x_c_axis_0, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<2>({2, 0})); + KokkosFFT::Plan plan_c2r_axes_2_1(execution_space(), x_c_axis_1, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<2>({2, 1})); // C2C plan - KokkosFFT::Impl::Plan plan_c2c_f_axes_0_1(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({0, 1})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_0_2(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({0, 2})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_1_0(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({1, 0})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_1_2(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({1, 2})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_2_0(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({2, 0})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_2_1(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<2>({2, 1})); + KokkosFFT::Plan plan_c2c_f_axes_0_1(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({0, 1})); + KokkosFFT::Plan plan_c2c_f_axes_0_2(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({0, 2})); + KokkosFFT::Plan plan_c2c_f_axes_1_0(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({1, 0})); + KokkosFFT::Plan plan_c2c_f_axes_1_2(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({1, 2})); + KokkosFFT::Plan plan_c2c_f_axes_2_0(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({2, 0})); + KokkosFFT::Plan plan_c2c_f_axes_2_1(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<2>({2, 1})); // Check if errors are correctly raised aginst wrong dirction // Input Real, Output Complex -> must be forward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_0_1( + KokkosFFT::Plan wrong_plan_r2c_axes_0_1( execution_space(), x, x_c_axis_1, KokkosFFT::Direction::backward, /*axes=*/axes_type<2>({0, 1})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_0_2( + KokkosFFT::Plan wrong_plan_r2c_axes_0_2( execution_space(), x, x_c_axis_2, KokkosFFT::Direction::backward, /*axes=*/axes_type<2>({0, 2})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_1_0( + KokkosFFT::Plan wrong_plan_r2c_axes_1_0( execution_space(), x, x_c_axis_0, KokkosFFT::Direction::backward, /*axes=*/axes_type<2>({1, 0})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_1_2( + KokkosFFT::Plan wrong_plan_r2c_axes_1_2( execution_space(), x, x_c_axis_2, KokkosFFT::Direction::backward, /*axes=*/axes_type<2>({1, 2})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_2_0( + KokkosFFT::Plan wrong_plan_r2c_axes_2_0( execution_space(), x, x_c_axis_0, KokkosFFT::Direction::backward, /*axes=*/axes_type<2>({2, 0})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_2_1( + KokkosFFT::Plan wrong_plan_r2c_axes_2_1( execution_space(), x, x_c_axis_1, KokkosFFT::Direction::backward, /*axes=*/axes_type<2>({2, 1})); }, @@ -598,42 +598,42 @@ void test_plan_2dfft_3dview() { // Input Complex, Output Real -> must be backward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_0_1( + KokkosFFT::Plan wrong_plan_c2r_axes_0_1( execution_space(), x_c_axis_1, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<2>({0, 1})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_0_2( + KokkosFFT::Plan wrong_plan_c2r_axes_0_2( execution_space(), x_c_axis_2, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<2>({0, 2})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_1_0( + KokkosFFT::Plan wrong_plan_c2r_axes_1_0( execution_space(), x_c_axis_0, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<2>({1, 0})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_1_2( + KokkosFFT::Plan wrong_plan_c2r_axes_1_2( execution_space(), x_c_axis_2, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<2>({1, 2})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_2_0( + KokkosFFT::Plan wrong_plan_c2r_axes_2_0( execution_space(), x_c_axis_0, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<2>({2, 0})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_2_1( + KokkosFFT::Plan wrong_plan_c2r_axes_2_1( execution_space(), x_c_axis_1, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<2>({2, 1})); }, @@ -671,105 +671,105 @@ void test_plan_3dfft_3dview() { ComplexView3DType x_cin("x_cin", n0, n1, n2), x_cout("x_cout", n0, n1, n2); // R2C plan - KokkosFFT::Impl::Plan plan_r2c_axes_0_1_2(execution_space(), x, x_c_axis_2, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({0, 1, 2})); - KokkosFFT::Impl::Plan plan_r2c_axes_0_2_1(execution_space(), x, x_c_axis_1, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({0, 2, 1})); - KokkosFFT::Impl::Plan plan_r2c_axes_1_0_2(execution_space(), x, x_c_axis_2, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({1, 0, 2})); - KokkosFFT::Impl::Plan plan_r2c_axes_1_2_0(execution_space(), x, x_c_axis_0, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({1, 2, 0})); - KokkosFFT::Impl::Plan plan_r2c_axes_2_0_1(execution_space(), x, x_c_axis_1, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({2, 0, 1})); - KokkosFFT::Impl::Plan plan_r2c_axes_2_1_0(execution_space(), x, x_c_axis_0, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({2, 1, 0})); + KokkosFFT::Plan plan_r2c_axes_0_1_2(execution_space(), x, x_c_axis_2, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({0, 1, 2})); + KokkosFFT::Plan plan_r2c_axes_0_2_1(execution_space(), x, x_c_axis_1, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({0, 2, 1})); + KokkosFFT::Plan plan_r2c_axes_1_0_2(execution_space(), x, x_c_axis_2, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({1, 0, 2})); + KokkosFFT::Plan plan_r2c_axes_1_2_0(execution_space(), x, x_c_axis_0, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({1, 2, 0})); + KokkosFFT::Plan plan_r2c_axes_2_0_1(execution_space(), x, x_c_axis_1, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({2, 0, 1})); + KokkosFFT::Plan plan_r2c_axes_2_1_0(execution_space(), x, x_c_axis_0, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({2, 1, 0})); // C2R plan - KokkosFFT::Impl::Plan plan_c2r_axes_0_1_2(execution_space(), x_c_axis_2, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<3>({0, 1, 2})); - KokkosFFT::Impl::Plan plan_c2r_axes_0_2_1(execution_space(), x_c_axis_1, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<3>({0, 2, 1})); - KokkosFFT::Impl::Plan plan_c2r_axes_1_0_2(execution_space(), x_c_axis_2, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<3>({1, 0, 2})); - KokkosFFT::Impl::Plan plan_c2r_axes_1_2_0(execution_space(), x_c_axis_0, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<3>({1, 2, 0})); - KokkosFFT::Impl::Plan plan_c2r_axes_2_0_1(execution_space(), x_c_axis_1, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<3>({2, 0, 1})); - KokkosFFT::Impl::Plan plan_c2r_axes_2_1_0(execution_space(), x_c_axis_0, x, - KokkosFFT::Direction::backward, - /*axes=*/axes_type<3>({2, 1, 0})); + KokkosFFT::Plan plan_c2r_axes_0_1_2(execution_space(), x_c_axis_2, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<3>({0, 1, 2})); + KokkosFFT::Plan plan_c2r_axes_0_2_1(execution_space(), x_c_axis_1, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<3>({0, 2, 1})); + KokkosFFT::Plan plan_c2r_axes_1_0_2(execution_space(), x_c_axis_2, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<3>({1, 0, 2})); + KokkosFFT::Plan plan_c2r_axes_1_2_0(execution_space(), x_c_axis_0, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<3>({1, 2, 0})); + KokkosFFT::Plan plan_c2r_axes_2_0_1(execution_space(), x_c_axis_1, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<3>({2, 0, 1})); + KokkosFFT::Plan plan_c2r_axes_2_1_0(execution_space(), x_c_axis_0, x, + KokkosFFT::Direction::backward, + /*axes=*/axes_type<3>({2, 1, 0})); // C2C plan - KokkosFFT::Impl::Plan plan_c2c_f_axes_0_1_2(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({0, 1, 2})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_0_2_1(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({0, 2, 1})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_1_0_2(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({1, 0, 2})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_1_2_0(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({1, 2, 0})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_2_0_1(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({2, 0, 1})); - KokkosFFT::Impl::Plan plan_c2c_f_axes_2_1_0(execution_space(), x_cin, x_cout, - KokkosFFT::Direction::forward, - /*axes=*/axes_type<3>({2, 1, 0})); + KokkosFFT::Plan plan_c2c_f_axes_0_1_2(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({0, 1, 2})); + KokkosFFT::Plan plan_c2c_f_axes_0_2_1(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({0, 2, 1})); + KokkosFFT::Plan plan_c2c_f_axes_1_0_2(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({1, 0, 2})); + KokkosFFT::Plan plan_c2c_f_axes_1_2_0(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({1, 2, 0})); + KokkosFFT::Plan plan_c2c_f_axes_2_0_1(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({2, 0, 1})); + KokkosFFT::Plan plan_c2c_f_axes_2_1_0(execution_space(), x_cin, x_cout, + KokkosFFT::Direction::forward, + /*axes=*/axes_type<3>({2, 1, 0})); // Check if errors are correctly raised aginst wrong dirction // Input Real, Output Complex -> must be forward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_0_1_2( + KokkosFFT::Plan wrong_plan_r2c_axes_0_1_2( execution_space(), x, x_c_axis_2, KokkosFFT::Direction::backward, /*axes=*/axes_type<3>({0, 1, 2})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_0_2_1( + KokkosFFT::Plan wrong_plan_r2c_axes_0_2_1( execution_space(), x, x_c_axis_1, KokkosFFT::Direction::backward, /*axes=*/axes_type<3>({0, 2, 1})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_1_0_2( + KokkosFFT::Plan wrong_plan_r2c_axes_1_0_2( execution_space(), x, x_c_axis_2, KokkosFFT::Direction::backward, /*axes=*/axes_type<3>({1, 0, 2})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_1_2_0( + KokkosFFT::Plan wrong_plan_r2c_axes_1_2_0( execution_space(), x, x_c_axis_0, KokkosFFT::Direction::backward, /*axes=*/axes_type<3>({1, 2, 0})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_2_0_1( + KokkosFFT::Plan wrong_plan_r2c_axes_2_0_1( execution_space(), x, x_c_axis_1, KokkosFFT::Direction::backward, /*axes=*/axes_type<3>({2, 0, 1})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_r2c_axes_2_1_0( + KokkosFFT::Plan wrong_plan_r2c_axes_2_1_0( execution_space(), x, x_c_axis_0, KokkosFFT::Direction::backward, /*axes=*/axes_type<3>({2, 1, 0})); }, @@ -778,42 +778,42 @@ void test_plan_3dfft_3dview() { // Input Complex, Output Real -> must be backward plan EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_0_1_2( + KokkosFFT::Plan wrong_plan_c2r_axes_0_1_2( execution_space(), x_c_axis_2, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<3>({0, 1, 2})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_0_2_1( + KokkosFFT::Plan wrong_plan_c2r_axes_0_2_1( execution_space(), x_c_axis_1, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<3>({0, 2, 1})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_1_0_2( + KokkosFFT::Plan wrong_plan_c2r_axes_1_0_2( execution_space(), x_c_axis_2, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<3>({1, 0, 2})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_1_2_0( + KokkosFFT::Plan wrong_plan_c2r_axes_1_2_0( execution_space(), x_c_axis_0, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<3>({1, 2, 0})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_2_0_1( + KokkosFFT::Plan wrong_plan_c2r_axes_2_0_1( execution_space(), x_c_axis_1, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<3>({2, 0, 1})); }, std::runtime_error); EXPECT_THROW( { - KokkosFFT::Impl::Plan wrong_plan_c2r_axes_2_1_0( + KokkosFFT::Plan wrong_plan_c2r_axes_2_1_0( execution_space(), x_c_axis_0, x, KokkosFFT::Direction::forward, /*axes=*/axes_type<3>({2, 1, 0})); }, diff --git a/fft/unit_test/Test_Transform.cpp b/fft/unit_test/Test_Transform.cpp index 584ed7c6..09045012 100644 --- a/fft/unit_test/Test_Transform.cpp +++ b/fft/unit_test/Test_Transform.cpp @@ -178,21 +178,21 @@ void test_fft1_identity_reuse_plan(T atol = 1.0e-12) { Kokkos::fence(); int axis = -1; - KokkosFFT::Impl::Plan fft_plan(execution_space(), a, out, - KokkosFFT::Direction::forward, axis); - KokkosFFT::Impl::fft_exec_impl(fft_plan, a, out); + KokkosFFT::Plan fft_plan(execution_space(), a, out, + KokkosFFT::Direction::forward, axis); + fft_plan.execute(a, out); - KokkosFFT::Impl::Plan ifft_plan(execution_space(), out, _a, - KokkosFFT::Direction::backward, axis); - KokkosFFT::Impl::fft_exec_impl(ifft_plan, out, _a); + KokkosFFT::Plan ifft_plan(execution_space(), out, _a, + KokkosFFT::Direction::backward, axis); + ifft_plan.execute(out, _a); - KokkosFFT::Impl::Plan rfft_plan(execution_space(), ar, outr, - KokkosFFT::Direction::forward, axis); - KokkosFFT::Impl::fft_exec_impl(rfft_plan, ar, outr); + KokkosFFT::Plan rfft_plan(execution_space(), ar, outr, + KokkosFFT::Direction::forward, axis); + rfft_plan.execute(ar, outr); - KokkosFFT::Impl::Plan irfft_plan(execution_space(), outr, _ar, - KokkosFFT::Direction::backward, axis); - KokkosFFT::Impl::fft_exec_impl(irfft_plan, outr, _ar); + KokkosFFT::Plan irfft_plan(execution_space(), outr, _ar, + KokkosFFT::Direction::backward, axis); + irfft_plan.execute(outr, _ar); EXPECT_TRUE(allclose(_a, a_ref, 1.e-5, atol)); EXPECT_TRUE(allclose(_ar, ar_ref, 1.e-5, atol)); @@ -213,17 +213,17 @@ void test_fft1_identity_reuse_plan(T atol = 1.0e-12) { // Create correct plans int axis = -1; - KokkosFFT::Impl::Plan fft_plan(execution_space(), a, out, - KokkosFFT::Direction::forward, axis); + KokkosFFT::Plan fft_plan(execution_space(), a, out, + KokkosFFT::Direction::forward, axis); - KokkosFFT::Impl::Plan ifft_plan(execution_space(), out, _a, - KokkosFFT::Direction::backward, axis); + KokkosFFT::Plan ifft_plan(execution_space(), out, _a, + KokkosFFT::Direction::backward, axis); - KokkosFFT::Impl::Plan rfft_plan(execution_space(), ar, outr, - KokkosFFT::Direction::forward, axis); + KokkosFFT::Plan rfft_plan(execution_space(), ar, outr, + KokkosFFT::Direction::forward, axis); - KokkosFFT::Impl::Plan irfft_plan(execution_space(), outr, _ar, - KokkosFFT::Direction::backward, axis); + KokkosFFT::Plan irfft_plan(execution_space(), outr, _ar, + KokkosFFT::Direction::backward, axis); // Check if errors are correctly raised aginst wrong extents const int maxlen_wrong = 32 * 2; @@ -234,52 +234,46 @@ void test_fft1_identity_reuse_plan(T atol = 1.0e-12) { // fft // With incorrect input shape - EXPECT_THROW(KokkosFFT::Impl::fft_exec_impl( - fft_plan, a_wrong, out, KokkosFFT::Normalization::backward), - std::runtime_error); + EXPECT_THROW( + fft_plan.execute(a_wrong, out, KokkosFFT::Normalization::backward), + std::runtime_error); // With incorrect output shape - EXPECT_THROW(KokkosFFT::Impl::fft_exec_impl( - fft_plan, a, out_wrong, KokkosFFT::Normalization::backward), - std::runtime_error); + EXPECT_THROW( + fft_plan.execute(a, out_wrong, KokkosFFT::Normalization::backward), + std::runtime_error); // ifft // With incorrect input shape EXPECT_THROW( - KokkosFFT::Impl::fft_exec_impl(ifft_plan, out_wrong, _a, - KokkosFFT::Normalization::backward), + ifft_plan.execute(out_wrong, _a, KokkosFFT::Normalization::backward), std::runtime_error); // With incorrect output shape EXPECT_THROW( - KokkosFFT::Impl::fft_exec_impl(ifft_plan, out, _a_wrong, - KokkosFFT::Normalization::backward), + ifft_plan.execute(out, _a_wrong, KokkosFFT::Normalization::backward), std::runtime_error); // rfft // With incorrect input shape EXPECT_THROW( - KokkosFFT::Impl::fft_exec_impl(rfft_plan, ar_wrong, outr, - KokkosFFT::Normalization::backward), + rfft_plan.execute(ar_wrong, outr, KokkosFFT::Normalization::backward), std::runtime_error); // With incorrect output shape EXPECT_THROW( - KokkosFFT::Impl::fft_exec_impl(rfft_plan, ar, out_wrong, - KokkosFFT::Normalization::backward), + rfft_plan.execute(ar, out_wrong, KokkosFFT::Normalization::backward), std::runtime_error); // irfft // With incorrect input shape EXPECT_THROW( - KokkosFFT::Impl::fft_exec_impl(irfft_plan, outr_wrong, _ar, - KokkosFFT::Normalization::backward), + irfft_plan.execute(outr_wrong, _ar, KokkosFFT::Normalization::backward), std::runtime_error); // With incorrect output shape EXPECT_THROW( - KokkosFFT::Impl::fft_exec_impl(irfft_plan, outr, _ar_wrong, - KokkosFFT::Normalization::backward), + irfft_plan.execute(outr, _ar_wrong, KokkosFFT::Normalization::backward), std::runtime_error); } @@ -1319,16 +1313,13 @@ void test_fft2_2dfft_2dview() { // Reuse plans using axes_type = KokkosFFT::axis_type<2>; axes_type axes = {-2, -1}; - KokkosFFT::Impl::Plan fft2_plan(execution_space(), x, out, - KokkosFFT::Direction::forward, axes); + KokkosFFT::Plan fft2_plan(execution_space(), x, out, + KokkosFFT::Direction::forward, axes); - KokkosFFT::Impl::fft_exec_impl(fft2_plan, x, out); - KokkosFFT::Impl::fft_exec_impl(fft2_plan, x, out_b, - KokkosFFT::Normalization::backward); - KokkosFFT::Impl::fft_exec_impl(fft2_plan, x, out_o, - KokkosFFT::Normalization::ortho); - KokkosFFT::Impl::fft_exec_impl(fft2_plan, x, out_f, - KokkosFFT::Normalization::forward); + fft2_plan.execute(x, out); + fft2_plan.execute(x, out_b, KokkosFFT::Normalization::backward); + fft2_plan.execute(x, out_o, KokkosFFT::Normalization::ortho); + fft2_plan.execute(x, out_f, KokkosFFT::Normalization::forward); multiply(out_o, sqrt(static_cast(n0 * n1))); multiply(out_f, static_cast(n0 * n1)); @@ -1361,15 +1352,12 @@ void test_fft2_2dfft_2dview() { EXPECT_TRUE(allclose(out_f, out2, 1.e-5, 1.e-6)); // Reuse plans np.fft2(axes=(-1, -2)) - KokkosFFT::Impl::Plan fft2_plan_axes10(execution_space(), x, out, - KokkosFFT::Direction::forward, axes10); + KokkosFFT::Plan fft2_plan_axes10(execution_space(), x, out, + KokkosFFT::Direction::forward, axes10); - KokkosFFT::Impl::fft_exec_impl(fft2_plan_axes10, x, out_b, - KokkosFFT::Normalization::backward); - KokkosFFT::Impl::fft_exec_impl(fft2_plan_axes10, x, out_o, - KokkosFFT::Normalization::ortho); - KokkosFFT::Impl::fft_exec_impl(fft2_plan_axes10, x, out_f, - KokkosFFT::Normalization::forward); + fft2_plan_axes10.execute(x, out_b, KokkosFFT::Normalization::backward); + fft2_plan_axes10.execute(x, out_o, KokkosFFT::Normalization::ortho); + fft2_plan_axes10.execute(x, out_f, KokkosFFT::Normalization::forward); multiply(out_o, sqrt(static_cast(n0 * n1))); multiply(out_f, static_cast(n0 * n1)); @@ -1423,16 +1411,13 @@ void test_fft2_2difft_2dview() { // Reuse plans using axes_type = KokkosFFT::axis_type<2>; axes_type axes = {-2, -1}; - KokkosFFT::Impl::Plan ifft2_plan(execution_space(), x, out, - KokkosFFT::Direction::backward, axes); + KokkosFFT::Plan ifft2_plan(execution_space(), x, out, + KokkosFFT::Direction::backward, axes); - KokkosFFT::Impl::fft_exec_impl(ifft2_plan, x, out); - KokkosFFT::Impl::fft_exec_impl(ifft2_plan, x, out_b, - KokkosFFT::Normalization::backward); - KokkosFFT::Impl::fft_exec_impl(ifft2_plan, x, out_o, - KokkosFFT::Normalization::ortho); - KokkosFFT::Impl::fft_exec_impl(ifft2_plan, x, out_f, - KokkosFFT::Normalization::forward); + ifft2_plan.execute(x, out); + ifft2_plan.execute(x, out_b, KokkosFFT::Normalization::backward); + ifft2_plan.execute(x, out_o, KokkosFFT::Normalization::ortho); + ifft2_plan.execute(x, out_f, KokkosFFT::Normalization::forward); multiply(out_o, 1.0 / sqrt(static_cast(n0 * n1))); multiply(out_f, 1.0 / static_cast(n0 * n1)); @@ -1463,15 +1448,12 @@ void test_fft2_2difft_2dview() { EXPECT_TRUE(allclose(out_o, out2, 1.e-5, 1.e-6)); EXPECT_TRUE(allclose(out_f, out2, 1.e-5, 1.e-6)); - KokkosFFT::Impl::Plan ifft2_plan_axes10( - execution_space(), x, out, KokkosFFT::Direction::backward, axes10); + KokkosFFT::Plan ifft2_plan_axes10(execution_space(), x, out, + KokkosFFT::Direction::backward, axes10); - KokkosFFT::Impl::fft_exec_impl(ifft2_plan_axes10, x, out_b, - KokkosFFT::Normalization::backward); - KokkosFFT::Impl::fft_exec_impl(ifft2_plan_axes10, x, out_o, - KokkosFFT::Normalization::ortho); - KokkosFFT::Impl::fft_exec_impl(ifft2_plan_axes10, x, out_f, - KokkosFFT::Normalization::forward); + ifft2_plan_axes10.execute(x, out_b, KokkosFFT::Normalization::backward); + ifft2_plan_axes10.execute(x, out_o, KokkosFFT::Normalization::ortho); + ifft2_plan_axes10.execute(x, out_f, KokkosFFT::Normalization::forward); multiply(out_o, 1.0 / sqrt(static_cast(n0 * n1))); multiply(out_f, 1.0 / static_cast(n0 * n1)); @@ -1532,23 +1514,20 @@ void test_fft2_2drfft_2dview() { // Reuse plans using axes_type = KokkosFFT::axis_type<2>; axes_type axes = {-2, -1}; - KokkosFFT::Impl::Plan rfft2_plan(execution_space(), x, out, - KokkosFFT::Direction::forward, axes); + KokkosFFT::Plan rfft2_plan(execution_space(), x, out, + KokkosFFT::Direction::forward, axes); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(rfft2_plan, x, out); + rfft2_plan.execute(x, out); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(rfft2_plan, x, out_b, - KokkosFFT::Normalization::backward); + rfft2_plan.execute(x, out_b, KokkosFFT::Normalization::backward); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(rfft2_plan, x, out_o, - KokkosFFT::Normalization::ortho); + rfft2_plan.execute(x, out_o, KokkosFFT::Normalization::ortho); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(rfft2_plan, x, out_f, - KokkosFFT::Normalization::forward); + rfft2_plan.execute(x, out_f, KokkosFFT::Normalization::forward); multiply(out_o, sqrt(static_cast(n0 * n1))); multiply(out_f, static_cast(n0 * n1)); @@ -1610,24 +1589,21 @@ void test_fft2_2dirfft_2dview() { // Reuse plans using axes_type = KokkosFFT::axis_type<2>; axes_type axes = {-2, -1}; - KokkosFFT::Impl::Plan irfft2_plan(execution_space(), x, out, - KokkosFFT::Direction::backward, axes); + KokkosFFT::Plan irfft2_plan(execution_space(), x, out, + KokkosFFT::Direction::backward, axes); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl( - irfft2_plan, x, out); // default: KokkosFFT::Normalization::backward + irfft2_plan.execute(x, + out); // default: KokkosFFT::Normalization::backward Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(irfft2_plan, x, out_b, - KokkosFFT::Normalization::backward); + irfft2_plan.execute(x, out_b, KokkosFFT::Normalization::backward); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(irfft2_plan, x, out_o, - KokkosFFT::Normalization::ortho); + irfft2_plan.execute(x, out_o, KokkosFFT::Normalization::ortho); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(irfft2_plan, x, out_f, - KokkosFFT::Normalization::forward); + irfft2_plan.execute(x, out_f, KokkosFFT::Normalization::forward); multiply(out_o, 1.0 / sqrt(static_cast(n0 * n1))); multiply(out_f, 1.0 / static_cast(n0 * n1)); @@ -2343,16 +2319,13 @@ void test_fftn_2dfft_2dview() { EXPECT_TRUE(allclose(out_f, out2, 1.e-5, 1.e-6)); // Reuse plans - KokkosFFT::Impl::Plan fftn_plan(execution_space(), x, out, - KokkosFFT::Direction::forward, axes); + KokkosFFT::Plan fftn_plan(execution_space(), x, out, + KokkosFFT::Direction::forward, axes); - KokkosFFT::Impl::fft_exec_impl(fftn_plan, x, out); - KokkosFFT::Impl::fft_exec_impl(fftn_plan, x, out_b, - KokkosFFT::Normalization::backward); - KokkosFFT::Impl::fft_exec_impl(fftn_plan, x, out_o, - KokkosFFT::Normalization::ortho); - KokkosFFT::Impl::fft_exec_impl(fftn_plan, x, out_f, - KokkosFFT::Normalization::forward); + fftn_plan.execute(x, out); + fftn_plan.execute(x, out_b, KokkosFFT::Normalization::backward); + fftn_plan.execute(x, out_o, KokkosFFT::Normalization::ortho); + fftn_plan.execute(x, out_f, KokkosFFT::Normalization::forward); multiply(out_o, sqrt(static_cast(n0 * n1))); multiply(out_f, static_cast(n0 * n1)); @@ -2411,16 +2384,13 @@ void test_ifftn_2dfft_2dview() { EXPECT_TRUE(allclose(out_f, out2, 1.e-5, 1.e-6)); // Reuse plans - KokkosFFT::Impl::Plan ifftn_plan(execution_space(), x, out, - KokkosFFT::Direction::backward, axes); + KokkosFFT::Plan ifftn_plan(execution_space(), x, out, + KokkosFFT::Direction::backward, axes); - KokkosFFT::Impl::fft_exec_impl(ifftn_plan, x, out); - KokkosFFT::Impl::fft_exec_impl(ifftn_plan, x, out_b, - KokkosFFT::Normalization::backward); - KokkosFFT::Impl::fft_exec_impl(ifftn_plan, x, out_o, - KokkosFFT::Normalization::ortho); - KokkosFFT::Impl::fft_exec_impl(ifftn_plan, x, out_f, - KokkosFFT::Normalization::forward); + ifftn_plan.execute(x, out); + ifftn_plan.execute(x, out_b, KokkosFFT::Normalization::backward); + ifftn_plan.execute(x, out_o, KokkosFFT::Normalization::ortho); + ifftn_plan.execute(x, out_f, KokkosFFT::Normalization::forward); multiply(out_o, 1.0 / sqrt(static_cast(n0 * n1))); multiply(out_f, 1.0 / static_cast(n0 * n1)); @@ -2487,23 +2457,20 @@ void test_rfftn_2dfft_2dview() { EXPECT_TRUE(allclose(out_f, out2, 1.e-5, 1.e-6)); // Reuse plans - KokkosFFT::Impl::Plan rfftn_plan(execution_space(), x, out, - KokkosFFT::Direction::forward, axes); + KokkosFFT::Plan rfftn_plan(execution_space(), x, out, + KokkosFFT::Direction::forward, axes); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(rfftn_plan, x, out); + rfftn_plan.execute(x, out); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(rfftn_plan, x, out_b, - KokkosFFT::Normalization::backward); + rfftn_plan.execute(x, out_b, KokkosFFT::Normalization::backward); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(rfftn_plan, x, out_o, - KokkosFFT::Normalization::ortho); + rfftn_plan.execute(x, out_o, KokkosFFT::Normalization::ortho); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(rfftn_plan, x, out_f, - KokkosFFT::Normalization::forward); + rfftn_plan.execute(x, out_f, KokkosFFT::Normalization::forward); multiply(out_o, sqrt(static_cast(n0 * n1))); multiply(out_f, static_cast(n0 * n1)); @@ -2572,22 +2539,19 @@ void test_irfftn_2dfft_2dview() { EXPECT_TRUE(allclose(out_f, out2, 1.e-5, 1.e-6)); // Reuse plans - KokkosFFT::Impl::Plan irfftn_plan(execution_space(), x, out, - KokkosFFT::Direction::backward, axes); + KokkosFFT::Plan irfftn_plan(execution_space(), x, out, + KokkosFFT::Direction::backward, axes); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(irfftn_plan, x, out); + irfftn_plan.execute(x, out); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(irfftn_plan, x, out_b, - KokkosFFT::Normalization::backward); + irfftn_plan.execute(x, out_b, KokkosFFT::Normalization::backward); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(irfftn_plan, x, out_o, - KokkosFFT::Normalization::ortho); + irfftn_plan.execute(x, out_o, KokkosFFT::Normalization::ortho); Kokkos::deep_copy(x, x_ref); - KokkosFFT::Impl::fft_exec_impl(irfftn_plan, x, out_f, - KokkosFFT::Normalization::forward); + irfftn_plan.execute(x, out_f, KokkosFFT::Normalization::forward); multiply(out_o, 1.0 / sqrt(static_cast(n0 * n1))); multiply(out_f, 1.0 / static_cast(n0 * n1));