Cufft problem input data overwritten

Hello,

I’m using the CUFFT library, and I have a problem…

i compute a R2C followed by a C2R transform (=> if I normalize, i get the same result, no problem with that)
(the transform is 2-dimensional, 6*6, for debugging purposes)

My problem is that, after calling
cufftExecC2R(plan, idata, odata);

the data inside idata is overwritten.

I’ve checked that idata != odata (no inplace transform), and even tried to allocate odata in a region of gpu memory that is very far from idata, but there is always the problem.

I can’t find in the doc something saying that input data is overwritten !

What to think ?

Thank you!

No idea ?

Is it just me, or it is an undocumented side effect ? (or a bug?)

Hi all, this is a natural behaviour which is documented.

The complex-to-real transform is implicitly inverse. For in-place complex-to-real FFTs where FFTW compatible output is selected (default padding mode), the input size is assumed to be ⌊N2⌋+1⌊N2⌋+1cufftComplex elements. Note that in-place complex-to-real FFTs may overwrite arbitrary imaginary input point values when non-unit input and output strides are chosen. Out-of-place complex-to-real FFT will always overwrite input buffer. For out-of-place transforms, input and output sizes match the logical transform non-redundant size ⌊N2⌋+1⌊N2⌋+1 and size NN, respectively.