Skip to content

Commit

Permalink
rename roll_impl and coefficients_impl
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Jul 8, 2024
1 parent 9ced145 commit 85f2ebc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions common/src/KokkosFFT_Helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ auto get_shift(const ViewType& inout, axis_type<DIM> _axes, int direction = 1) {
}

template <typename ExecutionSpace, typename ViewType>
void roll_impl(const ExecutionSpace& exec_space, ViewType& inout,
axis_type<1> shift, axis_type<1>) {
void roll(const ExecutionSpace& exec_space, ViewType& inout, axis_type<1> shift,
axis_type<1>) {
// Last parameter is ignored but present for keeping the interface consistent
static_assert(ViewType::rank() == 1, "roll_impl: Rank of View must be 1.");
static_assert(ViewType::rank() == 1, "roll: Rank of View must be 1.");
std::size_t n0 = inout.extent(0);

ViewType tmp("tmp", n0);
Expand All @@ -68,10 +68,10 @@ void roll_impl(const ExecutionSpace& exec_space, ViewType& inout,
}

template <typename ExecutionSpace, typename ViewType, std::size_t DIM1 = 1>
void roll_impl(const ExecutionSpace& exec_space, ViewType& inout,
axis_type<2> shift, axis_type<DIM1> axes) {
void roll(const ExecutionSpace& exec_space, ViewType& inout, axis_type<2> shift,
axis_type<DIM1> axes) {
constexpr int DIM0 = 2;
static_assert(ViewType::rank() == DIM0, "roll_impl: Rank of View must be 2.");
static_assert(ViewType::rank() == DIM0, "roll: Rank of View must be 2.");
int n0 = inout.extent(0), n1 = inout.extent(1);

ViewType tmp("tmp", n0, n1);
Expand Down Expand Up @@ -145,7 +145,7 @@ void fftshift_impl(const ExecutionSpace& exec_space, ViewType& inout,
"fftshift_impl: Rank of View must be larger thane "
"or equal to the Rank of shift axes.");
auto shift = get_shift(inout, axes);
roll_impl(exec_space, inout, shift, axes);
roll(exec_space, inout, shift, axes);
}

template <typename ExecutionSpace, typename ViewType, std::size_t DIM = 1>
Expand All @@ -165,7 +165,7 @@ void ifftshift_impl(const ExecutionSpace& exec_space, ViewType& inout,
"ifftshift_impl: Rank of View must be larger "
"thane or equal to the Rank of shift axes.");
auto shift = get_shift(inout, axes, -1);
roll_impl(exec_space, inout, shift, axes);
roll(exec_space, inout, shift, axes);
}
} // namespace Impl
} // namespace KokkosFFT
Expand Down
6 changes: 3 additions & 3 deletions common/src/KokkosFFT_normalization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ void normalize_impl(const ExecutionSpace& exec_space, ViewType& inout,
}

template <typename ViewType>
auto coefficients_impl(ViewType, Direction direction,
Normalization normalization, std::size_t fft_size) {
auto get_coefficients(ViewType, Direction direction,
Normalization normalization, std::size_t fft_size) {
using value_type =
KokkosFFT::Impl::real_type_t<typename ViewType::non_const_value_type>;
value_type coef = 1;
Expand Down Expand Up @@ -63,7 +63,7 @@ void normalize(const ExecutionSpace& exec_space, ViewType& inout,
Direction direction, Normalization normalization,
std::size_t fft_size) {
auto [coef, to_normalize] =
coefficients_impl(inout, direction, normalization, fft_size);
get_coefficients(inout, direction, normalization, fft_size);
if (to_normalize) normalize_impl(exec_space, inout, coef);
}

Expand Down

0 comments on commit 85f2ebc

Please sign in to comment.