Skip to content

Commit

Permalink
fix: scoped rocfft plan type
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Dec 19, 2024
1 parent 6f3c535 commit 5e81354
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions fft/src/KokkosFFT_ROCM_transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,54 +11,57 @@

namespace KokkosFFT {
namespace Impl {
void exec_plan(ScopedRocfftPlan<float>& scoped_plan, float* idata,
std::complex<float>* odata, int /*direction*/) {
inline void exec_plan(ScopedRocfftPlan<float>& scoped_plan, float* idata,
std::complex<float>* odata, int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
scoped_plan.execution_info());
KOKKOSFFT_THROW_IF(status != rocfft_status_success,
"rocfft_execute for R2C failed");
}

void exec_plan(ScopedRocfftPlan<double>& scoped_plan, double* idata,
std::complex<double>* odata, int /*direction*/) {
inline void exec_plan(ScopedRocfftPlan<double>& scoped_plan, double* idata,
std::complex<double>* odata, int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
scoped_plan.execution_info());
KOKKOSFFT_THROW_IF(status != rocfft_status_success,
"rocfft_execute for D2Z failed");
}

void exec_plan(ScopedRocfftPlan<float>& scoped_plan, std::complex<float>* idata,
float* odata, int /*direction*/) {
inline void exec_plan(ScopedRocfftPlan<Kokkos::complex<float>>& scoped_plan,
std::complex<float>* idata, float* odata,
int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
scoped_plan.execution_info());
KOKKOSFFT_THROW_IF(status != rocfft_status_success,
"rocfft_execute for C2R failed");
}

void exec_plan(ScopedRocfftPlan<double>& scoped_plan,
std::complex<double>* idata, double* odata, int /*direction*/) {
inline void exec_plan(ScopedRocfftPlan<Kokkos::complex<double>>& scoped_plan,
std::complex<double>* idata, double* odata,
int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
scoped_plan.execution_info());
KOKKOSFFT_THROW_IF(status != rocfft_status_success,
"rocfft_execute for Z2D failed");
}

void exec_plan(ScopedRocfftPlan<float>& scoped_plan, std::complex<float>* idata,
std::complex<float>* odata, int /*direction*/) {
inline void exec_plan(ScopedRocfftPlan<Kokkos::complex<float>>& scoped_plan,
std::complex<float>* idata, std::complex<float>* odata,
int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
scoped_plan.execution_info());
KOKKOSFFT_THROW_IF(status != rocfft_status_success,
"rocfft_execute for C2C failed");
}

void exec_plan(ScopedRocfftPlan<double>& scoped_plan,
std::complex<double>* idata, std::complex<double>* odata,
int /*direction*/) {
inline void exec_plan(ScopedRocfftPlan<Kokkos::complex<double>>& scoped_plan,
std::complex<double>* idata, std::complex<double>* odata,
int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
scoped_plan.execution_info());
Expand Down

0 comments on commit 5e81354

Please sign in to comment.