From fb9007b572a3af2d644fef0d03b51082134f8a52 Mon Sep 17 00:00:00 2001 From: Yuuichi Asahi Date: Sat, 5 Oct 2024 13:48:13 +0900 Subject: [PATCH] rename: is_in_place to is_inplace --- common/src/KokkosFFT_layouts.hpp | 6 +++--- fft/src/KokkosFFT_Cuda_plans.hpp | 16 ++++++++-------- fft/src/KokkosFFT_HIP_plans.hpp | 16 ++++++++-------- fft/src/KokkosFFT_Host_plans.hpp | 4 ++-- fft/src/KokkosFFT_Plans.hpp | 20 ++++++++++---------- fft/src/KokkosFFT_ROCM_plans.hpp | 6 +++--- fft/src/KokkosFFT_SYCL_plans.hpp | 6 +++--- fft/src/KokkosFFT_Transform.hpp | 4 ++-- fft/unit_test/Test_Transform.cpp | 12 ++++++------ 9 files changed, 45 insertions(+), 45 deletions(-) diff --git a/common/src/KokkosFFT_layouts.hpp b/common/src/KokkosFFT_layouts.hpp index 5fc4ecfd..97df49b8 100644 --- a/common/src/KokkosFFT_layouts.hpp +++ b/common/src/KokkosFFT_layouts.hpp @@ -22,7 +22,7 @@ namespace Impl { template auto get_extents(const InViewType& in, const OutViewType& out, axis_type axes, shape_type shape = {}, - bool is_in_place = false) { + bool is_inplace = false) { using in_value_type = typename InViewType::non_const_value_type; using out_value_type = typename OutViewType::non_const_value_type; using array_layout_type = typename InViewType::array_layout; @@ -66,7 +66,7 @@ auto get_extents(const InViewType& in, const OutViewType& out, if (is_real_v) { // Then R2C - if (is_in_place) { + if (is_inplace) { _in_extents.at(inner_most_axis) = _out_extents.at(inner_most_axis) * 2; } else { KOKKOSFFT_THROW_IF( @@ -79,7 +79,7 @@ auto get_extents(const InViewType& in, const OutViewType& out, if (is_real_v) { // Then C2R - if (is_in_place) { + if (is_inplace) { _out_extents.at(inner_most_axis) = _in_extents.at(inner_most_axis) * 2; } else { KOKKOSFFT_THROW_IF( diff --git a/fft/src/KokkosFFT_Cuda_plans.hpp b/fft/src/KokkosFFT_Cuda_plans.hpp index 80b37a99..bc579811 100644 --- a/fft/src/KokkosFFT_Cuda_plans.hpp +++ b/fft/src/KokkosFFT_Cuda_plans.hpp @@ -23,7 +23,7 @@ auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, Direction /*direction*/, axis_type<1> axes, shape_type<1> s, - bool is_in_place) { + bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -45,7 +45,7 @@ auto create_plan(const ExecutionSpace& exec_space, auto type = KokkosFFT::Impl::transform_type::type(); auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); const int nx = fft_extents.at(0); int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1, std::multiplies<>()); @@ -66,7 +66,7 @@ auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, Direction /*direction*/, axis_type<2> axes, shape_type<2> s, - bool is_in_place) { + bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -88,7 +88,7 @@ auto create_plan(const ExecutionSpace& exec_space, auto type = KokkosFFT::Impl::transform_type::type(); [[maybe_unused]] auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); const int nx = fft_extents.at(0), ny = fft_extents.at(1); int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1, std::multiplies<>()); @@ -109,7 +109,7 @@ auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, Direction /*direction*/, axis_type<3> axes, shape_type<3> s, - bool is_in_place) { + bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -131,7 +131,7 @@ auto create_plan(const ExecutionSpace& exec_space, auto type = KokkosFFT::Impl::transform_type::type(); [[maybe_unused]] auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); const int nx = fft_extents.at(0), ny = fft_extents.at(1), nz = fft_extents.at(2); @@ -154,7 +154,7 @@ auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, Direction /*direction*/, axis_type axes, - shape_type s, bool is_in_place) { + shape_type s, bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -175,7 +175,7 @@ auto create_plan(const ExecutionSpace& exec_space, KokkosFFT::Impl::transform_type::type(); auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); int idist = std::accumulate(in_extents.begin(), in_extents.end(), 1, std::multiplies<>()); int odist = std::accumulate(out_extents.begin(), out_extents.end(), 1, diff --git a/fft/src/KokkosFFT_HIP_plans.hpp b/fft/src/KokkosFFT_HIP_plans.hpp index 9d9a99ee..95e35c96 100644 --- a/fft/src/KokkosFFT_HIP_plans.hpp +++ b/fft/src/KokkosFFT_HIP_plans.hpp @@ -23,7 +23,7 @@ auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, Direction /*direction*/, axis_type<1> axes, shape_type<1> s, - bool is_in_place) { + bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -45,7 +45,7 @@ auto create_plan(const ExecutionSpace& exec_space, auto type = KokkosFFT::Impl::transform_type::type(); auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); const int nx = fft_extents.at(0); int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1, std::multiplies<>()); @@ -66,7 +66,7 @@ auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, Direction /*direction*/, axis_type<2> axes, shape_type<2> s, - bool is_in_place) { + bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -88,7 +88,7 @@ auto create_plan(const ExecutionSpace& exec_space, auto type = KokkosFFT::Impl::transform_type::type(); [[maybe_unused]] auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); const int nx = fft_extents.at(0), ny = fft_extents.at(1); int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1, std::multiplies<>()); @@ -109,7 +109,7 @@ auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, Direction /*direction*/, axis_type<3> axes, shape_type<3> s, - bool is_in_place) { + bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -131,7 +131,7 @@ auto create_plan(const ExecutionSpace& exec_space, auto type = KokkosFFT::Impl::transform_type::type(); [[maybe_unused]] auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); const int nx = fft_extents.at(0), ny = fft_extents.at(1), nz = fft_extents.at(2); @@ -154,7 +154,7 @@ auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, Direction /*direction*/, axis_type axes, - shape_type s, bool is_in_place) { + shape_type s, bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -175,7 +175,7 @@ auto create_plan(const ExecutionSpace& exec_space, KokkosFFT::Impl::transform_type::type(); auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); int idist = std::accumulate(in_extents.begin(), in_extents.end(), 1, std::multiplies<>()); int odist = std::accumulate(out_extents.begin(), out_extents.end(), 1, diff --git a/fft/src/KokkosFFT_Host_plans.hpp b/fft/src/KokkosFFT_Host_plans.hpp index aba640c4..79292694 100644 --- a/fft/src/KokkosFFT_Host_plans.hpp +++ b/fft/src/KokkosFFT_Host_plans.hpp @@ -38,7 +38,7 @@ auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, [[maybe_unused]] Direction direction, axis_type axes, - shape_type s, bool is_in_place) { + shape_type s, bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -64,7 +64,7 @@ auto create_plan(const ExecutionSpace& exec_space, KokkosFFT::Impl::transform_type::type(); auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); int idist = std::accumulate(in_extents.begin(), in_extents.end(), 1, std::multiplies<>()); int odist = std::accumulate(out_extents.begin(), out_extents.end(), 1, diff --git a/fft/src/KokkosFFT_Plans.hpp b/fft/src/KokkosFFT_Plans.hpp index 4e9ad77a..e1d62977 100644 --- a/fft/src/KokkosFFT_Plans.hpp +++ b/fft/src/KokkosFFT_Plans.hpp @@ -123,7 +123,7 @@ class Plan { bool m_is_crop_or_pad_needed = false; //! in-place transform or not - bool m_is_in_place = false; + bool m_is_inplace = false; //! axes for fft axis_type m_axes; @@ -204,16 +204,16 @@ class Plan { m_shape = KokkosFFT::Impl::get_modified_shape(in, out, s, m_axes); m_is_crop_or_pad_needed = KokkosFFT::Impl::is_crop_or_pad_needed(in, m_shape); - m_is_in_place = KokkosFFT::Impl::are_aliasing(in.data(), out.data()); - KOKKOSFFT_THROW_IF(m_is_in_place && m_is_transpose_needed, + m_is_inplace = KokkosFFT::Impl::are_aliasing(in.data(), out.data()); + KOKKOSFFT_THROW_IF(m_is_inplace && m_is_transpose_needed, "In-place transform is not supported with transpose. " "Please use out-of-place transform."); - KOKKOSFFT_THROW_IF(m_is_in_place && m_is_crop_or_pad_needed, + KOKKOSFFT_THROW_IF(m_is_inplace && m_is_crop_or_pad_needed, "In-place transform is not supported with reshape. " "Please use out-of-place transform."); m_fft_size = KokkosFFT::Impl::create_plan(exec_space, m_plan, in, out, m_buffer, m_info, direction, - m_axes, s, m_is_in_place); + m_axes, s, m_is_inplace); } /// \brief Constructor for multidimensional FFT @@ -267,16 +267,16 @@ class Plan { m_shape = KokkosFFT::Impl::get_modified_shape(in, out, s, m_axes); m_is_crop_or_pad_needed = KokkosFFT::Impl::is_crop_or_pad_needed(in, m_shape); - m_is_in_place = KokkosFFT::Impl::are_aliasing(in.data(), out.data()); - KOKKOSFFT_THROW_IF(m_is_in_place && m_is_transpose_needed, + m_is_inplace = KokkosFFT::Impl::are_aliasing(in.data(), out.data()); + KOKKOSFFT_THROW_IF(m_is_inplace && m_is_transpose_needed, "In-place transform is not supported with transpose. " "Please use out-of-place transform."); - KOKKOSFFT_THROW_IF(m_is_in_place && m_is_crop_or_pad_needed, + KOKKOSFFT_THROW_IF(m_is_inplace && m_is_crop_or_pad_needed, "In-place transform is not supported with reshape. " "Please use out-of-place transform."); m_fft_size = KokkosFFT::Impl::create_plan(exec_space, m_plan, in, out, m_buffer, - m_info, direction, axes, s, m_is_in_place); + m_info, direction, axes, s, m_is_inplace); } ~Plan() { @@ -333,7 +333,7 @@ class Plan { 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; } - bool is_in_place() const { return m_is_in_place; } + bool is_inplace() const { return m_is_inplace; } extents_type shape() const { return m_shape; } map_type map() const { return m_map; } map_type map_inv() const { return m_map_inv; } diff --git a/fft/src/KokkosFFT_ROCM_plans.hpp b/fft/src/KokkosFFT_ROCM_plans.hpp index 7f6ebb34..363a6706 100644 --- a/fft/src/KokkosFFT_ROCM_plans.hpp +++ b/fft/src/KokkosFFT_ROCM_plans.hpp @@ -94,7 +94,7 @@ auto create_plan(const ExecutionSpace& exec_space, const OutViewType& out, BufferViewType& buffer, InfoType& execution_info, Direction direction, axis_type axes, shape_type s, - bool is_in_place) { + bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -114,7 +114,7 @@ auto create_plan(const ExecutionSpace& exec_space, KokkosFFT::Impl::transform_type::type(); auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); int idist = std::accumulate(in_extents.begin(), in_extents.end(), 1, std::multiplies<>()); int odist = std::accumulate(out_extents.begin(), out_extents.end(), 1, @@ -156,7 +156,7 @@ auto create_plan(const ExecutionSpace& exec_space, // Out-of-place transform const rocfft_result_placement place = - is_in_place ? rocfft_placement_inplace : rocfft_placement_notinplace; + is_inplace ? rocfft_placement_inplace : rocfft_placement_notinplace; // Create a plan plan = std::make_unique(); diff --git a/fft/src/KokkosFFT_SYCL_plans.hpp b/fft/src/KokkosFFT_SYCL_plans.hpp index 6b8c86ae..eaa9691c 100644 --- a/fft/src/KokkosFFT_SYCL_plans.hpp +++ b/fft/src/KokkosFFT_SYCL_plans.hpp @@ -54,7 +54,7 @@ auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, Direction /*direction*/, axis_type axes, - shape_type s, bool is_in_place) { + shape_type s, bool is_inplace) { static_assert( KokkosFFT::Impl::are_operatable_views_v, @@ -69,7 +69,7 @@ auto create_plan(const ExecutionSpace& exec_space, "KokkosFFT::create_plan: Rank of View must be larger than Rank of FFT."); auto [in_extents, out_extents, fft_extents, howmany] = - KokkosFFT::Impl::get_extents(in, out, axes, s, is_in_place); + KokkosFFT::Impl::get_extents(in, out, axes, s, is_inplace); int idist = std::accumulate(in_extents.begin(), in_extents.end(), 1, std::multiplies<>()); int odist = std::accumulate(out_extents.begin(), out_extents.end(), 1, @@ -99,7 +99,7 @@ auto create_plan(const ExecutionSpace& exec_space, static_cast(howmany)); // Data layout in conjugate-even domain - int placement = is_in_place ? DFTI_INPLACE : DFTI_NOT_INPLACE; + int placement = is_inplace ? DFTI_INPLACE : DFTI_NOT_INPLACE; plan->set_value(oneapi::mkl::dft::config_param::PLACEMENT, placement); plan->set_value(oneapi::mkl::dft::config_param::CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX); diff --git a/fft/src/KokkosFFT_Transform.hpp b/fft/src/KokkosFFT_Transform.hpp index 274923e1..04ecb25a 100644 --- a/fft/src/KokkosFFT_Transform.hpp +++ b/fft/src/KokkosFFT_Transform.hpp @@ -65,8 +65,8 @@ void exec_impl( KokkosFFT::Impl::exec_plan(plan.plan(), idata, odata, direction, plan.info()); if constexpr (is_complex_v && is_real_v) { - auto const is_in_place = plan.is_in_place(); - if (is_in_place) { + auto const is_inplace = plan.is_inplace(); + if (is_inplace) { // For the in-place Complex to Real transform, the output must be reshaped // to fit the original size (in.size() * 2) for correct normalization using OutUViewType = diff --git a/fft/unit_test/Test_Transform.cpp b/fft/unit_test/Test_Transform.cpp index 492fb1cb..5e7f66db 100644 --- a/fft/unit_test/Test_Transform.cpp +++ b/fft/unit_test/Test_Transform.cpp @@ -75,7 +75,7 @@ void test_fft1_identity(T atol = 1.0e-12) { } template -void test_fft1_identity_in_place(T atol = 1.0e-12) { +void test_fft1_identity_inplace(T atol = 1.0e-12) { const int maxlen = 32; using RealView1DType = Kokkos::View; using RealUView1DType = Kokkos::View ? 1.0e-6 : 1.0e-12; - test_fft1_identity_in_place(atol); + test_fft1_identity_inplace(atol); } // Identity tests on 1D Views with plan reuse @@ -1695,7 +1695,7 @@ void test_fft2_2dfft_2dview_shape(T atol = 1.0e-12) { } template -void test_fft2_2dfft_2dview_in_place(T atol = 1.0e-12) { +void test_fft2_2dfft_2dview_inplace([[maybe_unused]] T atol = 1.0e-12) { const int n0 = 4, n1 = 6; using RealView2DType = Kokkos::View; using RealUView2DType = Kokkos::View(); + test_fft2_2dfft_2dview_inplace(); } // batced fft2 on 3D Views