Skip to content

Commit

Permalink
fix: Rocm types
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Dec 17, 2024
1 parent a6ccd56 commit 701136e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions fft/src/KokkosFFT_ROCM_transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace KokkosFFT {
namespace Impl {
template <typename ScopedPlanType>
void exec_plan(const ScopedPlanType& scoped_plan, float* idata,
void exec_plan(ScopedPlanType& scoped_plan, float* idata,
std::complex<float>* odata, int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
Expand All @@ -22,7 +22,7 @@ void exec_plan(const ScopedPlanType& scoped_plan, float* idata,
}

template <typename ScopedPlanType>
void exec_plan(const ScopedPlanType& scoped_plan, double* idata,
void exec_plan(ScopedPlanType& scoped_plan, double* idata,
std::complex<double>* odata, int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
Expand All @@ -32,7 +32,7 @@ void exec_plan(const ScopedPlanType& scoped_plan, double* idata,
}

template <typename ScopedPlanType>
void exec_plan(const ScopedPlanType& scoped_plan, std::complex<float>* idata,
void exec_plan(ScopedPlanType& scoped_plan, std::complex<float>* idata,
float* odata, int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
Expand All @@ -42,7 +42,7 @@ void exec_plan(const ScopedPlanType& scoped_plan, std::complex<float>* idata,
}

template <typename ScopedPlanType>
void exec_plan(const ScopedPlanType& scoped_plan, std::complex<double>* idata,
void exec_plan(ScopedPlanType& scoped_plan, std::complex<double>* idata,
double* odata, int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
Expand All @@ -52,7 +52,7 @@ void exec_plan(const ScopedPlanType& scoped_plan, std::complex<double>* idata,
}

template <typename ScopedPlanType>
void exec_plan(const ScopedPlanType& scoped_plan, std::complex<float>* idata,
void exec_plan(ScopedPlanType& scoped_plan, std::complex<float>* idata,
std::complex<float>* odata, int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
Expand All @@ -62,7 +62,7 @@ void exec_plan(const ScopedPlanType& scoped_plan, std::complex<float>* idata,
}

template <typename ScopedPlanType>
void exec_plan(const ScopedPlanType& scoped_plan, std::complex<double>* idata,
void exec_plan(ScopedPlanType& scoped_plan, std::complex<double>* idata,
std::complex<double>* odata, int /*direction*/) {
rocfft_status status =
rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata,
Expand Down
4 changes: 2 additions & 2 deletions fft/src/KokkosFFT_ROCM_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ struct ScopedRocfftPlan {

// Helper to convert the integer type of vectors
template <typename InType, typename OutType>
auto convert_int_type_and_reverse(std::vector<InType> &in)
auto convert_int_type_and_reverse(const std::vector<InType> &in)
-> std::vector<OutType> {
std::vector<OutType> out(in.size());
std::transform(
in.begin(), in.end(), out.begin(),
in.cbegin(), in.cend(), out.begin(),
[](const InType v) -> OutType { return static_cast<OutType>(v); });

std::reverse(out.begin(), out.end());
Expand Down

0 comments on commit 701136e

Please sign in to comment.