diff --git a/common/src/KokkosFFT_layouts.hpp b/common/src/KokkosFFT_Extents.hpp similarity index 86% rename from common/src/KokkosFFT_layouts.hpp rename to common/src/KokkosFFT_Extents.hpp index f78f0343..95a4dc34 100644 --- a/common/src/KokkosFFT_layouts.hpp +++ b/common/src/KokkosFFT_Extents.hpp @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception -#ifndef KOKKOSFFT_LAYOUTS_HPP -#define KOKKOSFFT_LAYOUTS_HPP +#ifndef KOKKOSFFT_EXTENTS_HPP +#define KOKKOSFFT_EXTENTS_HPP #include #include @@ -16,9 +16,20 @@ namespace KokkosFFT { namespace Impl { -/* Input and output extents exposed to the fft library - i.e extents are converted into Layout Right -*/ +/// \brief Compute input, output and fft extents required for FFT +/// libraries based on the input view, output view, axes and shape. +/// Extents are converted into Layout Right +/// +/// \tparam InViewType The input view type +/// \tparam OutViewType The output view type +/// \tparam DIM The dimensionality of the axes +/// +/// \param in [in] Input view +/// \param out [in] Output view +/// \param axes [in] Axes over which the FFT operations are performed. +/// \param shape [in] The new shape of the input view. If the shape is zero, +/// no modifications are made. +/// \param is_inplace [in] Whether the FFT is inplace or not template auto get_extents(const InViewType& in, const OutViewType& out, axis_type axes, shape_type shape = {}, diff --git a/common/unit_test/CMakeLists.txt b/common/unit_test/CMakeLists.txt index 67678abc..50a1c15d 100644 --- a/common/unit_test/CMakeLists.txt +++ b/common/unit_test/CMakeLists.txt @@ -8,7 +8,7 @@ add_executable(unit-tests-kokkos-fft-common Test_Traits.cpp Test_Normalization.cpp Test_Transpose.cpp - Test_Layouts.cpp + Test_Extents.cpp Test_Padding.cpp Test_Helpers.cpp ) diff --git a/common/unit_test/Test_Layouts.cpp b/common/unit_test/Test_Extents.cpp similarity index 97% rename from common/unit_test/Test_Layouts.cpp rename to common/unit_test/Test_Extents.cpp index aed6d4b7..28ddbc97 100644 --- a/common/unit_test/Test_Layouts.cpp +++ b/common/unit_test/Test_Extents.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "KokkosFFT_layouts.hpp" +#include "KokkosFFT_Extents.hpp" #include "Test_Types.hpp" #include "Test_Utils.hpp" @@ -13,21 +13,21 @@ using test_types = ::testing::Types; // Basically the same fixtures, used for labeling tests template -struct Layouts1D : public ::testing::Test { +struct Extents1D : public ::testing::Test { using layout_type = T; }; template -struct Layouts2D : public ::testing::Test { +struct Extents2D : public ::testing::Test { using layout_type = T; }; -TYPED_TEST_SUITE(Layouts1D, test_types); -TYPED_TEST_SUITE(Layouts2D, test_types); +TYPED_TEST_SUITE(Extents1D, test_types); +TYPED_TEST_SUITE(Extents2D, test_types); // Tests for 1D FFT template -void test_layouts_1d() { +void test_extents_1d() { const int n0 = 6; using axes_type = KokkosFFT::axis_type<1>; using RealView1Dtype = Kokkos::View; @@ -90,7 +90,7 @@ void test_layouts_1d() { } template -void test_layouts_1d_batched_FFT_2d() { +void test_extents_1d_batched_FFT_2d() { const int n0 = 6, n1 = 10; using axes_type = KokkosFFT::axis_type<1>; using RealView2Dtype = Kokkos::View; @@ -179,7 +179,7 @@ void test_layouts_1d_batched_FFT_2d() { } template -void test_layouts_1d_batched_FFT_3d() { +void test_extents_1d_batched_FFT_3d() { const int n0 = 6, n1 = 10, n2 = 8; using axes_type = KokkosFFT::axis_type<1>; using RealView3Dtype = Kokkos::View; @@ -308,27 +308,27 @@ void test_layouts_1d_batched_FFT_3d() { EXPECT_EQ(howmany_c2c_axis2, ref_howmany_r2c_axis2); } -TYPED_TEST(Layouts1D, 1DFFT_1DView) { +TYPED_TEST(Extents1D, 1DFFT_1DView) { using layout_type = typename TestFixture::layout_type; - test_layouts_1d(); + test_extents_1d(); } -TYPED_TEST(Layouts1D, 1DFFT_batched_2DView) { +TYPED_TEST(Extents1D, 1DFFT_batched_2DView) { using layout_type = typename TestFixture::layout_type; - test_layouts_1d_batched_FFT_2d(); + test_extents_1d_batched_FFT_2d(); } -TYPED_TEST(Layouts1D, 1DFFT_batched_3DView) { +TYPED_TEST(Extents1D, 1DFFT_batched_3DView) { using layout_type = typename TestFixture::layout_type; - test_layouts_1d_batched_FFT_3d(); + test_extents_1d_batched_FFT_3d(); } // Tests for 2D FFT template -void test_layouts_2d() { +void test_extents_2d() { const int n0 = 6, n1 = 10; using axes_type = KokkosFFT::axis_type<2>; using RealView2Dtype = Kokkos::View; @@ -432,7 +432,7 @@ void test_layouts_2d() { } template -void test_layouts_2d_batched_FFT_3d() { +void test_extents_2d_batched_FFT_3d() { const int n0 = 6, n1 = 10, n2 = 8; using axes_type = KokkosFFT::axis_type<2>; using RealView3Dtype = Kokkos::View; @@ -711,14 +711,14 @@ void test_layouts_2d_batched_FFT_3d() { EXPECT_EQ(howmany_c2c_axis_21, ref_howmany_r2c_axis_21); } -TYPED_TEST(Layouts2D, 2DFFT_2DView) { +TYPED_TEST(Extents2D, 2DFFT_2DView) { using layout_type = typename TestFixture::layout_type; - test_layouts_2d(); + test_extents_2d(); } -TYPED_TEST(Layouts2D, 2DFFT_3DView) { +TYPED_TEST(Extents2D, 2DFFT_3DView) { using layout_type = typename TestFixture::layout_type; - test_layouts_2d_batched_FFT_3d(); + test_extents_2d_batched_FFT_3d(); } diff --git a/fft/src/KokkosFFT_Cuda_plans.hpp b/fft/src/KokkosFFT_Cuda_plans.hpp index a704c209..9abd8451 100644 --- a/fft/src/KokkosFFT_Cuda_plans.hpp +++ b/fft/src/KokkosFFT_Cuda_plans.hpp @@ -7,7 +7,7 @@ #include #include "KokkosFFT_Cuda_types.hpp" -#include "KokkosFFT_layouts.hpp" +#include "KokkosFFT_Extents.hpp" #include "KokkosFFT_traits.hpp" #include "KokkosFFT_asserts.hpp" diff --git a/fft/src/KokkosFFT_HIP_plans.hpp b/fft/src/KokkosFFT_HIP_plans.hpp index ef41e307..c94ed23e 100644 --- a/fft/src/KokkosFFT_HIP_plans.hpp +++ b/fft/src/KokkosFFT_HIP_plans.hpp @@ -7,7 +7,7 @@ #include #include "KokkosFFT_HIP_types.hpp" -#include "KokkosFFT_layouts.hpp" +#include "KokkosFFT_Extents.hpp" #include "KokkosFFT_traits.hpp" #include "KokkosFFT_asserts.hpp" diff --git a/fft/src/KokkosFFT_Host_plans.hpp b/fft/src/KokkosFFT_Host_plans.hpp index 4cdc52e4..7b66522e 100644 --- a/fft/src/KokkosFFT_Host_plans.hpp +++ b/fft/src/KokkosFFT_Host_plans.hpp @@ -7,7 +7,7 @@ #include #include "KokkosFFT_default_types.hpp" -#include "KokkosFFT_layouts.hpp" +#include "KokkosFFT_Extents.hpp" #include "KokkosFFT_traits.hpp" namespace KokkosFFT { diff --git a/fft/src/KokkosFFT_ROCM_plans.hpp b/fft/src/KokkosFFT_ROCM_plans.hpp index e80199e4..e1b115e9 100644 --- a/fft/src/KokkosFFT_ROCM_plans.hpp +++ b/fft/src/KokkosFFT_ROCM_plans.hpp @@ -8,7 +8,7 @@ #include #include #include "KokkosFFT_ROCM_types.hpp" -#include "KokkosFFT_layouts.hpp" +#include "KokkosFFT_Extents.hpp" #include "KokkosFFT_traits.hpp" #include "KokkosFFT_asserts.hpp" #include "KokkosFFT_utils.hpp" diff --git a/fft/src/KokkosFFT_SYCL_plans.hpp b/fft/src/KokkosFFT_SYCL_plans.hpp index 96b0cc06..fa9d232c 100644 --- a/fft/src/KokkosFFT_SYCL_plans.hpp +++ b/fft/src/KokkosFFT_SYCL_plans.hpp @@ -8,7 +8,7 @@ #include #include #include "KokkosFFT_SYCL_types.hpp" -#include "KokkosFFT_layouts.hpp" +#include "KokkosFFT_Extents.hpp" #include "KokkosFFT_traits.hpp" #include "KokkosFFT_utils.hpp"