Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Oct 30, 2024
1 parent d51e33c commit d38fbb1
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions common/src/KokkosFFT_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ auto extract_extents(const ViewType& view) {
}

template <typename InViewType, typename OutViewType>
auto shrank_slicers(const InViewType& in,
const OutViewType& out) {
auto shrank_slicers(const InViewType& in, const OutViewType& out) {
static_assert(
KokkosFFT::Impl::have_same_rank_v<InViewType, OutViewType>,
"shrank_slicers: InViewType and OutViewType must have the same rank.");
Expand All @@ -222,28 +221,27 @@ auto shrank_slicers(const InViewType& in,
for (std::size_t i = 0; i < rank; i++) {
extents.at(i) = std::min(in.extent(i), out.extent(i));
}



if constexpr (rank == 1) {
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>>;
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>>;
slicers_type slicers = {Kokkos::make_pair(0, extents.at(0))};
return slicers;
} else if constexpr (rank == 2) {
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>>;
slicers_type slicers = {Kokkos::make_pair(0, extents.at(0)),
Kokkos::make_pair(0, extents.at(1))};
return slicers;
} else if constexpr (rank == 3) {
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>>;
slicers_type slicers = {Kokkos::make_pair(0, extents.at(0)),
Kokkos::make_pair(0, extents.at(1)),
Kokkos::make_pair(0, extents.at(2))};
return slicers;
} else if constexpr (rank == 4) {
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>>;
Expand All @@ -253,7 +251,7 @@ auto shrank_slicers(const InViewType& in,
Kokkos::make_pair(0, extents.at(3))};
return slicers;
} else if constexpr (rank == 5) {
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Expand All @@ -265,7 +263,7 @@ auto shrank_slicers(const InViewType& in,
Kokkos::make_pair(0, extents.at(4))};
return slicers;
} else if constexpr (rank == 6) {
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Expand All @@ -279,7 +277,7 @@ auto shrank_slicers(const InViewType& in,
Kokkos::make_pair(0, extents.at(5))};
return slicers;
} else if constexpr (rank == 7) {
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Expand All @@ -295,7 +293,7 @@ auto shrank_slicers(const InViewType& in,
Kokkos::make_pair(0, extents.at(6))};
return slicers;
} else {
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
using slicers_type = std::tuple<Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Kokkos::pair<std::size_t, std::size_t>,
Expand Down

0 comments on commit d38fbb1

Please sign in to comment.