diff --git a/fft/src/KokkosFFT_ROCM_transform.hpp b/fft/src/KokkosFFT_ROCM_transform.hpp index b96e861d..fc4832a4 100644 --- a/fft/src/KokkosFFT_ROCM_transform.hpp +++ b/fft/src/KokkosFFT_ROCM_transform.hpp @@ -11,7 +11,7 @@ namespace KokkosFFT { namespace Impl { -inline void exec_plan(ScopedRocfftPlan& scoped_plan, float* idata, +inline void exec_plan(const ScopedRocfftPlan& scoped_plan, float* idata, std::complex* odata, int /*direction*/) { rocfft_status status = rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata, @@ -20,8 +20,9 @@ inline void exec_plan(ScopedRocfftPlan& scoped_plan, float* idata, "rocfft_execute for R2C failed"); } -inline void exec_plan(ScopedRocfftPlan& scoped_plan, double* idata, - std::complex* odata, int /*direction*/) { +inline void exec_plan(const ScopedRocfftPlan& scoped_plan, + double* idata, std::complex* odata, + int /*direction*/) { rocfft_status status = rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata, scoped_plan.execution_info()); @@ -29,9 +30,9 @@ inline void exec_plan(ScopedRocfftPlan& scoped_plan, double* idata, "rocfft_execute for D2Z failed"); } -inline void exec_plan(ScopedRocfftPlan>& scoped_plan, - std::complex* idata, float* odata, - int /*direction*/) { +inline void exec_plan( + const ScopedRocfftPlan>& scoped_plan, + std::complex* idata, float* odata, int /*direction*/) { rocfft_status status = rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata, scoped_plan.execution_info()); @@ -39,9 +40,9 @@ inline void exec_plan(ScopedRocfftPlan>& scoped_plan, "rocfft_execute for C2R failed"); } -inline void exec_plan(ScopedRocfftPlan>& scoped_plan, - std::complex* idata, double* odata, - int /*direction*/) { +inline void exec_plan( + const ScopedRocfftPlan>& scoped_plan, + std::complex* idata, double* odata, int /*direction*/) { rocfft_status status = rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata, scoped_plan.execution_info()); @@ -49,9 +50,9 @@ inline void exec_plan(ScopedRocfftPlan>& scoped_plan, "rocfft_execute for Z2D failed"); } -inline void exec_plan(ScopedRocfftPlan>& scoped_plan, - std::complex* idata, std::complex* odata, - int /*direction*/) { +inline void exec_plan( + const ScopedRocfftPlan>& scoped_plan, + std::complex* idata, std::complex* odata, int /*direction*/) { rocfft_status status = rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata, scoped_plan.execution_info()); @@ -59,9 +60,10 @@ inline void exec_plan(ScopedRocfftPlan>& scoped_plan, "rocfft_execute for C2C failed"); } -inline void exec_plan(ScopedRocfftPlan>& scoped_plan, - std::complex* idata, std::complex* odata, - int /*direction*/) { +inline void exec_plan( + const ScopedRocfftPlan>& scoped_plan, + std::complex* idata, std::complex* odata, + int /*direction*/) { rocfft_status status = rocfft_execute(scoped_plan.plan(), (void**)&idata, (void**)&odata, scoped_plan.execution_info()); diff --git a/fft/src/KokkosFFT_ROCM_types.hpp b/fft/src/KokkosFFT_ROCM_types.hpp index 69b9a3f4..e3907e86 100644 --- a/fft/src/KokkosFFT_ROCM_types.hpp +++ b/fft/src/KokkosFFT_ROCM_types.hpp @@ -56,7 +56,7 @@ struct ScopedRocfftPlanDescription { Kokkos::abort("rocfft_plan_description_destroy failed"); } - rocfft_plan_description &description() { return m_description; } + rocfft_plan_description description() const noexcept { return m_description; } }; /// \brief A class that wraps rocfft for RAII @@ -172,7 +172,9 @@ struct ScopedRocfftPlan { ScopedRocfftPlan(ScopedRocfftPlan &&) = delete; rocfft_plan plan() const noexcept { return m_plan; } - rocfft_execution_info &execution_info() { return m_execution_info; } + rocfft_execution_info execution_info() const noexcept { + return m_execution_info; + } private: void cleanup() {