1
0
mirror of https://github.com/paboyle/Grid.git synced 2026-05-27 12:34:16 +01:00

FFT HIP: use hipfftCreate+hipfftMakePlanMany instead of hipfftPlanMany

This commit is contained in:
Peter Boyle
2026-05-19 17:29:28 -04:00
parent a9f42c08f9
commit 119888653c
+11 -5
View File
@@ -74,11 +74,14 @@ public:
FFTW_scalar *out, int *onembed,
int ostride, int odist,
int sign, unsigned flags) {
// hipfftPlanMany (one-step) triggers HIPFFT_PARSE_ERROR (12) on some
// ROCm versions. The two-step hipfftCreate + hipfftMakePlanMany is
// more robust across ROCm releases.
FFTW_plan p;
// Pass nullptr for inembed/onembed: contiguous layout is the default and
// avoids HIPFFT_PARSE_ERROR (12) triggered by some rocFFT versions when
// inembed==n (non-null, no-padding case).
auto rv = hipfftPlanMany(&p,rank,n,nullptr,istride,idist,nullptr,ostride,odist,HIPFFT_Z2Z,howmany);
size_t workSize;
auto rc = hipfftCreate(&p);
GRID_ASSERT(rc==HIPFFT_SUCCESS);
auto rv = hipfftMakePlanMany(p,rank,n,nullptr,istride,idist,nullptr,ostride,odist,HIPFFT_Z2Z,howmany,&workSize);
GRID_ASSERT(rv==HIPFFT_SUCCESS);
return p;
}
@@ -104,7 +107,10 @@ public:
int ostride, int odist,
int sign, unsigned flags) {
FFTW_plan p;
auto rv = hipfftPlanMany(&p,rank,n,nullptr,istride,idist,nullptr,ostride,odist,HIPFFT_C2C,howmany);
size_t workSize;
auto rc = hipfftCreate(&p);
GRID_ASSERT(rc==HIPFFT_SUCCESS);
auto rv = hipfftMakePlanMany(p,rank,n,nullptr,istride,idist,nullptr,ostride,odist,HIPFFT_C2C,howmany,&workSize);
GRID_ASSERT(rv==HIPFFT_SUCCESS);
return p;
}