diff --git a/.clang-format b/.clang-format index 7729ac95..289d7c76 100644 --- a/.clang-format +++ b/.clang-format @@ -8,3 +8,4 @@ AlignConsecutiveAssignments: true AllowShortCaseLabelsOnASingleLine: true AllowShortIfStatementsOnASingleLine: true CommentPragmas: ' SPDX-' +InsertNewlineAtEOF: true diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index a2e7b5ff..2df9db5f 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -23,12 +23,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: DoozyX/clang-format-lint-action@v0.13 + - uses: DoozyX/clang-format-lint-action@v0.18 with: - source: 'common/ fft/ examples/' + source: 'common/ fft/ examples/ install_test/' exclude: '' extensions: 'hpp,cpp' - clangFormatVersion: 12 + clangFormatVersion: 17 # check if Docker images should be recreated check_docker_files: diff --git a/common/src/KokkosFFT_Helpers.hpp b/common/src/KokkosFFT_Helpers.hpp index f564f08b..e37b858f 100644 --- a/common/src/KokkosFFT_Helpers.hpp +++ b/common/src/KokkosFFT_Helpers.hpp @@ -313,4 +313,4 @@ void ifftshift(const ExecutionSpace& exec_space, ViewType& inout, } } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/common/src/KokkosFFT_common_types.hpp b/common/src/KokkosFFT_common_types.hpp index bc726743..d15b496a 100644 --- a/common/src/KokkosFFT_common_types.hpp +++ b/common/src/KokkosFFT_common_types.hpp @@ -39,4 +39,4 @@ constexpr std::size_t MAX_FFT_DIM = 3; } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/common/src/KokkosFFT_normalization.hpp b/common/src/KokkosFFT_normalization.hpp index c5a24024..89aff343 100644 --- a/common/src/KokkosFFT_normalization.hpp +++ b/common/src/KokkosFFT_normalization.hpp @@ -86,4 +86,4 @@ inline auto swap_direction(Normalization normalization) { } // namespace Impl } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/common/unit_test/Test_Helpers.cpp b/common/unit_test/Test_Helpers.cpp index 60a05766..197d59c7 100644 --- a/common/unit_test/Test_Helpers.cpp +++ b/common/unit_test/Test_Helpers.cpp @@ -150,9 +150,9 @@ void test_get_shift(int direction) { KokkosFFT::axis_type<2> shift1_axis1_odd_ref = {0, direction * n2 / 2}; KokkosFFT::axis_type<2> shift1_axis1_even_ref = {0, direction * n2 / 2}; KokkosFFT::axis_type<2> shift2_odd_ref = {direction * n_odd / 2, - direction * n2 / 2}; + direction * n2 / 2}; KokkosFFT::axis_type<2> shift2_even_ref = {direction * n_even / 2, - direction * n2 / 2}; + direction * n2 / 2}; auto shift1_odd = KokkosFFT::Impl::get_shift( x1_odd, KokkosFFT::axis_type<1>({0}), direction); @@ -266,7 +266,7 @@ void test_fftshift1D_2DView(int n0) { if (n0 % 2 == 0) { _x_ref = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1}; + -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1}; _y0_ref = { 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, -15, -14, -13, -12, -11, 10, 11, 12, 13, 14, -5, -4, -3, -2, -1, -10, -9, -8, -7, -6, @@ -276,7 +276,7 @@ void test_fftshift1D_2DView(int n0) { 10, 11, 12, 13, 14, -15, -14, -13, -12, -11}; } else { _x_ref = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1}; + -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1}; _y0_ref = {5, 6, 7, 8, 0, 1, 2, 3, 4, -13, -12, -11, -10, 9, 10, 11, 12, 13, -4, -3, -2, -1, -9, -8, -7, -6, -5}; _y1_ref = {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, @@ -387,4 +387,4 @@ TEST_P(FFTShiftParamTests, 2DShift2DView) { } INSTANTIATE_TEST_SUITE_P(FFTShift, FFTShiftParamTests, - ::testing::Values(9, 10)); \ No newline at end of file + ::testing::Values(9, 10)); diff --git a/common/unit_test/Test_Layouts.cpp b/common/unit_test/Test_Layouts.cpp index ebf4c220..7c2208df 100644 --- a/common/unit_test/Test_Layouts.cpp +++ b/common/unit_test/Test_Layouts.cpp @@ -721,4 +721,4 @@ TYPED_TEST(Layouts2D, 2DFFT_3DView) { using layout_type = typename TestFixture::layout_type; test_layouts_2d_batched_FFT_3d(); -} \ No newline at end of file +} diff --git a/common/unit_test/Test_Normalization.cpp b/common/unit_test/Test_Normalization.cpp index 1db78a28..62f60d49 100644 --- a/common/unit_test/Test_Normalization.cpp +++ b/common/unit_test/Test_Normalization.cpp @@ -120,4 +120,4 @@ TEST(Normalization, None) { KokkosFFT::Direction::backward, KokkosFFT::Normalization::none, len); EXPECT_TRUE(allclose(x_b, ref_b, 1.e-5, 1.e-12)); -} \ No newline at end of file +} diff --git a/common/unit_test/Test_Padding.cpp b/common/unit_test/Test_Padding.cpp index b0f261da..f163b9f6 100644 --- a/common/unit_test/Test_Padding.cpp +++ b/common/unit_test/Test_Padding.cpp @@ -1704,4 +1704,4 @@ TEST(CropOrPad8D, 8DView) { } } } -} \ No newline at end of file +} diff --git a/common/unit_test/Test_Transpose.cpp b/common/unit_test/Test_Transpose.cpp index a59d7de9..b2480ba5 100644 --- a/common/unit_test/Test_Transpose.cpp +++ b/common/unit_test/Test_Transpose.cpp @@ -2440,4 +2440,4 @@ TYPED_TEST(Transpose3D, 8DView) { using layout_type = typename TestFixture::layout_type; test_transpose_3d_8dview(); -} \ No newline at end of file +} diff --git a/common/unit_test/Test_Types.hpp b/common/unit_test/Test_Types.hpp index ab7c6011..f3051862 100644 --- a/common/unit_test/Test_Types.hpp +++ b/common/unit_test/Test_Types.hpp @@ -36,4 +36,4 @@ using RightView2D = Kokkos::View; template using RightView3D = Kokkos::View; -#endif \ No newline at end of file +#endif diff --git a/examples/01_1DFFT/01_1DFFT.cpp b/examples/01_1DFFT/01_1DFFT.cpp index 7b951ad0..99d439d2 100644 --- a/examples/01_1DFFT/01_1DFFT.cpp +++ b/examples/01_1DFFT/01_1DFFT.cpp @@ -47,4 +47,4 @@ int main(int argc, char* argv[]) { Kokkos::finalize(); return 0; -} \ No newline at end of file +} diff --git a/examples/02_2DFFT/02_2DFFT.cpp b/examples/02_2DFFT/02_2DFFT.cpp index 68ec7b8e..48d7e357 100644 --- a/examples/02_2DFFT/02_2DFFT.cpp +++ b/examples/02_2DFFT/02_2DFFT.cpp @@ -47,4 +47,4 @@ int main(int argc, char* argv[]) { Kokkos::finalize(); return 0; -} \ No newline at end of file +} diff --git a/examples/04_batchedFFT/04_batchedFFT.cpp b/examples/04_batchedFFT/04_batchedFFT.cpp index 0f8df3ce..0391b516 100644 --- a/examples/04_batchedFFT/04_batchedFFT.cpp +++ b/examples/04_batchedFFT/04_batchedFFT.cpp @@ -51,4 +51,4 @@ int main(int argc, char* argv[]) { Kokkos::finalize(); return 0; -} \ No newline at end of file +} diff --git a/examples/05_1DFFT_HOST_DEVICE/05_1DFFT_HOST_DEVICE.cpp b/examples/05_1DFFT_HOST_DEVICE/05_1DFFT_HOST_DEVICE.cpp index 217b6a4a..2dc1c09c 100644 --- a/examples/05_1DFFT_HOST_DEVICE/05_1DFFT_HOST_DEVICE.cpp +++ b/examples/05_1DFFT_HOST_DEVICE/05_1DFFT_HOST_DEVICE.cpp @@ -82,4 +82,4 @@ int main(int argc, char* argv[]) { Kokkos::finalize(); return 0; -} \ No newline at end of file +} 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 17f7f6a8..0b478063 100644 --- a/examples/06_1DFFT_reuse_plans/06_1DFFT_reuse_plans.cpp +++ b/examples/06_1DFFT_reuse_plans/06_1DFFT_reuse_plans.cpp @@ -57,4 +57,4 @@ int main(int argc, char* argv[]) { Kokkos::finalize(); return 0; -} \ No newline at end of file +} diff --git a/fft/perf_test/Benchmark_Context.hpp b/fft/perf_test/Benchmark_Context.hpp index d6dccd46..ae4032f9 100644 --- a/fft/perf_test/Benchmark_Context.hpp +++ b/fft/perf_test/Benchmark_Context.hpp @@ -121,4 +121,4 @@ void report_results(benchmark::State& state, InViewType in, OutViewType out, } // namespace KokkosFFTBenchmark -#endif \ No newline at end of file +#endif diff --git a/fft/perf_test/PerfTest_FFT1.cpp b/fft/perf_test/PerfTest_FFT1.cpp index df687ec1..6eebceaa 100644 --- a/fft/perf_test/PerfTest_FFT1.cpp +++ b/fft/perf_test/PerfTest_FFT1.cpp @@ -122,4 +122,4 @@ BENCHMARK(IRFFT_1DView) ->UseManualTime() ->Unit(benchmark::kMicrosecond); -} // namespace KokkosFFTBenchmark \ No newline at end of file +} // namespace KokkosFFTBenchmark diff --git a/fft/perf_test/PerfTest_FFT1.hpp b/fft/perf_test/PerfTest_FFT1.hpp index f051984a..430c7cbf 100644 --- a/fft/perf_test/PerfTest_FFT1.hpp +++ b/fft/perf_test/PerfTest_FFT1.hpp @@ -104,4 +104,4 @@ static void IRFFT_1DView(benchmark::State& state) { } // namespace KokkosFFTBenchmark -#endif \ No newline at end of file +#endif diff --git a/fft/perf_test/PerfTest_FFT2.cpp b/fft/perf_test/PerfTest_FFT2.cpp index 4f8a1903..cf0182dd 100644 --- a/fft/perf_test/PerfTest_FFT2.cpp +++ b/fft/perf_test/PerfTest_FFT2.cpp @@ -122,4 +122,4 @@ BENCHMARK(IRFFT2_2DView) ->UseManualTime() ->Unit(benchmark::kMicrosecond); -} // namespace KokkosFFTBenchmark \ No newline at end of file +} // namespace KokkosFFTBenchmark diff --git a/fft/perf_test/PerfTest_FFT2.hpp b/fft/perf_test/PerfTest_FFT2.hpp index 7a1883b6..4faf1cee 100644 --- a/fft/perf_test/PerfTest_FFT2.hpp +++ b/fft/perf_test/PerfTest_FFT2.hpp @@ -105,4 +105,4 @@ static void IRFFT2_2DView(benchmark::State& state) { } // namespace KokkosFFTBenchmark -#endif \ No newline at end of file +#endif diff --git a/fft/src/KokkosFFT.hpp b/fft/src/KokkosFFT.hpp index b79384df..d3bdb8c5 100644 --- a/fft/src/KokkosFFT.hpp +++ b/fft/src/KokkosFFT.hpp @@ -11,4 +11,4 @@ #include "KokkosFFT_Plans.hpp" #include "KokkosFFT_Transform.hpp" -#endif \ No newline at end of file +#endif diff --git a/fft/src/KokkosFFT_Cuda_plans.hpp b/fft/src/KokkosFFT_Cuda_plans.hpp index 3b84bed3..850f71bb 100644 --- a/fft/src/KokkosFFT_Cuda_plans.hpp +++ b/fft/src/KokkosFFT_Cuda_plans.hpp @@ -174,9 +174,9 @@ auto create_plan(const ExecutionSpace& exec_space, auto [in_extents, out_extents, fft_extents, howmany] = KokkosFFT::Impl::get_extents(in, out, axes, s); int idist = std::accumulate(in_extents.begin(), in_extents.end(), 1, - std::multiplies<>()); + std::multiplies<>()); int odist = std::accumulate(out_extents.begin(), out_extents.end(), 1, - std::multiplies<>()); + std::multiplies<>()); int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1, std::multiplies<>()); diff --git a/fft/src/KokkosFFT_Cuda_types.hpp b/fft/src/KokkosFFT_Cuda_types.hpp index 0a66538a..620cb914 100644 --- a/fft/src/KokkosFFT_Cuda_types.hpp +++ b/fft/src/KokkosFFT_Cuda_types.hpp @@ -208,4 +208,4 @@ auto direction_type(Direction direction) { } // namespace Impl } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/fft/src/KokkosFFT_HIP_plans.hpp b/fft/src/KokkosFFT_HIP_plans.hpp index 77cfe3e4..2ab41a4c 100644 --- a/fft/src/KokkosFFT_HIP_plans.hpp +++ b/fft/src/KokkosFFT_HIP_plans.hpp @@ -174,9 +174,9 @@ auto create_plan(const ExecutionSpace& exec_space, auto [in_extents, out_extents, fft_extents, howmany] = KokkosFFT::Impl::get_extents(in, out, axes, s); int idist = std::accumulate(in_extents.begin(), in_extents.end(), 1, - std::multiplies<>()); + std::multiplies<>()); int odist = std::accumulate(out_extents.begin(), out_extents.end(), 1, - std::multiplies<>()); + std::multiplies<>()); int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1, std::multiplies<>()); diff --git a/fft/src/KokkosFFT_HIP_types.hpp b/fft/src/KokkosFFT_HIP_types.hpp index d460fc15..6af8159c 100644 --- a/fft/src/KokkosFFT_HIP_types.hpp +++ b/fft/src/KokkosFFT_HIP_types.hpp @@ -208,4 +208,4 @@ auto direction_type(Direction direction) { } // namespace Impl } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/fft/src/KokkosFFT_Host_plans.hpp b/fft/src/KokkosFFT_Host_plans.hpp index d99cf195..3dc7bed1 100644 --- a/fft/src/KokkosFFT_Host_plans.hpp +++ b/fft/src/KokkosFFT_Host_plans.hpp @@ -66,9 +66,9 @@ auto create_plan(const ExecutionSpace& exec_space, auto [in_extents, out_extents, fft_extents, howmany] = KokkosFFT::Impl::get_extents(in, out, axes, s); int idist = std::accumulate(in_extents.begin(), in_extents.end(), 1, - std::multiplies<>()); + std::multiplies<>()); int odist = std::accumulate(out_extents.begin(), out_extents.end(), 1, - std::multiplies<>()); + std::multiplies<>()); int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1, std::multiplies<>()); diff --git a/fft/src/KokkosFFT_Host_transform.hpp b/fft/src/KokkosFFT_Host_transform.hpp index 094bb0a6..c2cbb03b 100644 --- a/fft/src/KokkosFFT_Host_transform.hpp +++ b/fft/src/KokkosFFT_Host_transform.hpp @@ -47,4 +47,4 @@ void exec_plan(PlanType plan, fftw_complex* idata, fftw_complex* odata, } // namespace Impl } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/fft/src/KokkosFFT_Host_types.hpp b/fft/src/KokkosFFT_Host_types.hpp index 0bcb8c92..8c094980 100644 --- a/fft/src/KokkosFFT_Host_types.hpp +++ b/fft/src/KokkosFFT_Host_types.hpp @@ -95,4 +95,4 @@ auto direction_type(Direction direction) { } // namespace Impl } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/fft/src/KokkosFFT_Plans.hpp b/fft/src/KokkosFFT_Plans.hpp index 9ec5dae6..b80bc139 100644 --- a/fft/src/KokkosFFT_Plans.hpp +++ b/fft/src/KokkosFFT_Plans.hpp @@ -263,11 +263,11 @@ class Plan { fft_info_type>(m_plan, m_info); } - Plan() = delete; - Plan(const Plan&) = delete; + Plan() = delete; + Plan(const Plan&) = delete; Plan& operator=(const Plan&) = delete; - Plan& operator=(Plan&&) = delete; - Plan(Plan&&) = delete; + Plan& operator=(Plan&&) = delete; + Plan(Plan&&) = delete; /// \brief Execute FFT on input and output Views with normalization /// diff --git a/fft/src/KokkosFFT_ROCM_plans.hpp b/fft/src/KokkosFFT_ROCM_plans.hpp index ec29ec4a..08d7457d 100644 --- a/fft/src/KokkosFFT_ROCM_plans.hpp +++ b/fft/src/KokkosFFT_ROCM_plans.hpp @@ -113,9 +113,9 @@ auto create_plan(const ExecutionSpace& exec_space, auto [in_extents, out_extents, fft_extents, howmany] = KokkosFFT::Impl::get_extents(in, out, axes, s); int idist = std::accumulate(in_extents.begin(), in_extents.end(), 1, - std::multiplies<>()); + std::multiplies<>()); int odist = std::accumulate(out_extents.begin(), out_extents.end(), 1, - std::multiplies<>()); + std::multiplies<>()); int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1, std::multiplies<>()); diff --git a/fft/src/KokkosFFT_ROCM_types.hpp b/fft/src/KokkosFFT_ROCM_types.hpp index 0d11c259..7870dbb9 100644 --- a/fft/src/KokkosFFT_ROCM_types.hpp +++ b/fft/src/KokkosFFT_ROCM_types.hpp @@ -146,4 +146,4 @@ auto direction_type(Direction direction) { } // namespace Impl } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/fft/src/KokkosFFT_SYCL_plans.hpp b/fft/src/KokkosFFT_SYCL_plans.hpp index 2c9b3a91..2b36a4b0 100644 --- a/fft/src/KokkosFFT_SYCL_plans.hpp +++ b/fft/src/KokkosFFT_SYCL_plans.hpp @@ -70,9 +70,9 @@ auto create_plan(const ExecutionSpace& exec_space, auto [in_extents, out_extents, fft_extents, howmany] = KokkosFFT::Impl::get_extents(in, out, axes, s); int idist = std::accumulate(in_extents.begin(), in_extents.end(), 1, - std::multiplies<>()); + std::multiplies<>()); int odist = std::accumulate(out_extents.begin(), out_extents.end(), 1, - std::multiplies<>()); + std::multiplies<>()); int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1, std::multiplies<>()); @@ -118,4 +118,4 @@ void destroy_plan_and_info(std::unique_ptr&, InfoType&) { } // namespace Impl } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/fft/src/KokkosFFT_SYCL_transform.hpp b/fft/src/KokkosFFT_SYCL_transform.hpp index 5cff1c14..1de3a7bf 100644 --- a/fft/src/KokkosFFT_SYCL_transform.hpp +++ b/fft/src/KokkosFFT_SYCL_transform.hpp @@ -60,4 +60,4 @@ void exec_plan(PlanType& plan, std::complex* idata, } // namespace Impl } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/fft/src/KokkosFFT_SYCL_types.hpp b/fft/src/KokkosFFT_SYCL_types.hpp index c36d5ad2..9cb5ecdd 100644 --- a/fft/src/KokkosFFT_SYCL_types.hpp +++ b/fft/src/KokkosFFT_SYCL_types.hpp @@ -253,4 +253,4 @@ auto direction_type(Direction direction) { } // namespace Impl } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/fft/src/KokkosFFT_default_types.hpp b/fft/src/KokkosFFT_default_types.hpp index a52bb590..6629e8be 100644 --- a/fft/src/KokkosFFT_default_types.hpp +++ b/fft/src/KokkosFFT_default_types.hpp @@ -48,4 +48,4 @@ struct fft_data_type> { } // namespace Impl } // namespace KokkosFFT -#endif \ No newline at end of file +#endif diff --git a/fft/unit_test/Test_Transform.cpp b/fft/unit_test/Test_Transform.cpp index 09045012..2607fab5 100644 --- a/fft/unit_test/Test_Transform.cpp +++ b/fft/unit_test/Test_Transform.cpp @@ -3464,4 +3464,4 @@ TYPED_TEST(FFTND, 3DFFT_batched_8DView) { float_type atol = std::is_same_v ? 1.0e-5 : 1.0e-10; test_fftn_3dfft_8dview(atol); -} \ No newline at end of file +} diff --git a/fft/unit_test/Test_Types.hpp b/fft/unit_test/Test_Types.hpp index 3060db4b..da45d6fd 100644 --- a/fft/unit_test/Test_Types.hpp +++ b/fft/unit_test/Test_Types.hpp @@ -26,4 +26,4 @@ using RightView2D = Kokkos::View; template using RightView3D = Kokkos::View; -#endif \ No newline at end of file +#endif diff --git a/fft/unit_test/Test_Utils.hpp b/fft/unit_test/Test_Utils.hpp index e34a6782..055db441 100644 --- a/fft/unit_test/Test_Utils.hpp +++ b/fft/unit_test/Test_Utils.hpp @@ -66,4 +66,4 @@ void display(ViewType& a) { std::cout << std::resetiosflags(std::ios_base::floatfield); } -#endif \ No newline at end of file +#endif diff --git a/install_test/as_library/hello.cpp b/install_test/as_library/hello.cpp index 7b951ad0..99d439d2 100644 --- a/install_test/as_library/hello.cpp +++ b/install_test/as_library/hello.cpp @@ -47,4 +47,4 @@ int main(int argc, char* argv[]) { Kokkos::finalize(); return 0; -} \ No newline at end of file +} diff --git a/install_test/as_subdirectory/hello.cpp b/install_test/as_subdirectory/hello.cpp index 68ec7b8e..48d7e357 100644 --- a/install_test/as_subdirectory/hello.cpp +++ b/install_test/as_subdirectory/hello.cpp @@ -47,4 +47,4 @@ int main(int argc, char* argv[]) { Kokkos::finalize(); return 0; -} \ No newline at end of file +}