mirror of
https://github.com/paboyle/Grid.git
synced 2026-05-28 13:04:17 +01:00
FFT HIP: use hipfftCreate+hipfftMakePlanMany instead of hipfftPlanMany
This commit is contained in:
+11
-5
@@ -74,11 +74,14 @@ public:
|
|||||||
FFTW_scalar *out, int *onembed,
|
FFTW_scalar *out, int *onembed,
|
||||||
int ostride, int odist,
|
int ostride, int odist,
|
||||||
int sign, unsigned flags) {
|
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;
|
FFTW_plan p;
|
||||||
// Pass nullptr for inembed/onembed: contiguous layout is the default and
|
size_t workSize;
|
||||||
// avoids HIPFFT_PARSE_ERROR (12) triggered by some rocFFT versions when
|
auto rc = hipfftCreate(&p);
|
||||||
// inembed==n (non-null, no-padding case).
|
GRID_ASSERT(rc==HIPFFT_SUCCESS);
|
||||||
auto rv = hipfftPlanMany(&p,rank,n,nullptr,istride,idist,nullptr,ostride,odist,HIPFFT_Z2Z,howmany);
|
auto rv = hipfftMakePlanMany(p,rank,n,nullptr,istride,idist,nullptr,ostride,odist,HIPFFT_Z2Z,howmany,&workSize);
|
||||||
GRID_ASSERT(rv==HIPFFT_SUCCESS);
|
GRID_ASSERT(rv==HIPFFT_SUCCESS);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@@ -104,7 +107,10 @@ public:
|
|||||||
int ostride, int odist,
|
int ostride, int odist,
|
||||||
int sign, unsigned flags) {
|
int sign, unsigned flags) {
|
||||||
FFTW_plan p;
|
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);
|
GRID_ASSERT(rv==HIPFFT_SUCCESS);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user