24#ifdef ESPRESSO_KOKKOS_FFT
30#include <boost/mpi/communicator.hpp>
32#include <KokkosFFT.hpp>
33#include <Kokkos_Core.hpp>
66template <
typename FloatType,
class FFTConfig>
68 static_assert(FFTConfig::use_r2c,
69 "kokkos-fft P3M backend implements the r2c transform only");
70 static_assert(FFTConfig::r2c_dir == 2u,
71 "kokkos-fft P3M backend reduces the contiguous last axis");
74 "kokkos-fft P3M backend supports row-major layout only");
77 using ComplexType =
typename Base::ComplexType;
78 using RSpaceScalar =
typename Base::RSpaceScalar;
79 using KComplex = Kokkos::complex<FloatType>;
80 using ExecSpace = Kokkos::DefaultHostExecutionSpace;
83 Kokkos::View<FloatType ***, Kokkos::LayoutRight, Kokkos::HostSpace>;
85 Kokkos::View<FloatType ***, Kokkos::LayoutRight, Kokkos::HostSpace,
86 Kokkos::MemoryTraits<Kokkos::Unmanaged>>;
88 Kokkos::View<
KComplex ***, Kokkos::LayoutRight, Kokkos::HostSpace,
89 Kokkos::MemoryTraits<Kokkos::Unmanaged>>;
90 using ForwardPlan = KokkosFFT::Plan<ExecSpace, RealViewU, CplxViewU, 3>;
91 using BackwardPlan = KokkosFFT::Plan<ExecSpace, CplxViewU, RealViewU, 3>;
104 static_cast<void>(comm);
109 "P3MFFTKokkos::real_scratch"),
113 Utils::Vector3i ks_local_ld_index()
const override {
return {0, 0, 0}; }
120 RSpaceScalar *forward_input_buffer()
override {
124 void forward(RSpaceScalar
const *
in, ComplexType *
out)
override {
137 m_forward = std::make_unique<ForwardPlan>(
139 KokkosFFT::axis_type<3>({0, 1, 2}));
143 KokkosFFT::Normalization::none);
146 void backward(ComplexType *
in, RSpaceScalar *
out)
override {
154 out_view, KokkosFFT::Normalization::none);
162 std::unique_ptr<BackwardPlan>
plan;
181 auto plan = std::make_unique<BackwardPlan>(
183 KokkosFFT::axis_type<3>({0, 1, 2}));
Vector implementation and trait types for boost qvm interoperability.
DEVICE_QUALIFIER constexpr pointer data() noexcept
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
Abstract interface for the P3M reciprocal-space FFT.