Skip to content

Commit

Permalink
Use new APIs to reuse plan in example
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Apr 15, 2024
1 parent 4204a2f commit a6a8cc4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions examples/06_1DFFT_reuse_plans/06_1DFFT_reuse_plans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ int main(int argc, char* argv[]) {
int axis = -1;
KokkosFFT::Impl::Plan fft_plan(exec, xc2c, xc2c_hat,
KokkosFFT::Direction::forward, axis);
KokkosFFT::fft(exec, xc2c, xc2c_hat, fft_plan);
// KokkosFFT::fft(exec, xc2c, xc2c_hat, fft_plan);
KokkosFFT::Impl::fft_exec_impl(fft_plan, xc2c, xc2c_hat);
exec.fence();

KokkosFFT::Impl::Plan ifft_plan(exec, xc2c_hat, xc2c_inv,
KokkosFFT::Direction::backward, axis);
KokkosFFT::ifft(exec, xc2c_hat, xc2c_inv, ifft_plan);
// KokkosFFT::ifft(exec, xc2c_hat, xc2c_inv, ifft_plan);
KokkosFFT::Impl::fft_exec_impl(ifft_plan, xc2c_hat, xc2c_inv);
exec.fence();

// 1D R2C FFT
Expand All @@ -46,7 +48,8 @@ int main(int argc, char* argv[]) {

KokkosFFT::Impl::Plan rfft_plan(exec, xr2c, xr2c_hat,
KokkosFFT::Direction::forward, axis);
KokkosFFT::rfft(exec, xr2c, xr2c_hat, rfft_plan);
// KokkosFFT::rfft(exec, xr2c, xr2c_hat, rfft_plan);
KokkosFFT::Impl::fft_exec_impl(rfft_plan, xr2c, xr2c_hat);
exec.fence();

// 1D C2R FFT
Expand All @@ -57,7 +60,8 @@ int main(int argc, char* argv[]) {

KokkosFFT::Impl::Plan irfft_plan(exec, xc2r, xc2r_hat,
KokkosFFT::Direction::backward, axis);
KokkosFFT::irfft(exec, xc2r, xc2r_hat, irfft_plan);
// KokkosFFT::irfft(exec, xc2r, xc2r_hat, irfft_plan);
KokkosFFT::Impl::fft_exec_impl(irfft_plan, xc2r, xc2r_hat);
exec.fence();
}
Kokkos::finalize();
Expand Down

0 comments on commit a6a8cc4

Please sign in to comment.