CUFFT partial corruption problem - random affects Its works but its not quite right???

badfft.rtf (6.27 MB)


I am doing a 2d fft on a 512x512 image which has a 20x20 block test pattern in the middle. I perform the forward real to complex transform and then a reverse complex to real. The result is sort of the same picture but there is random artefacts in it suggesting some kind of corruption of my data.

See the attached file. It shows the starting image on the right and the resultant image after going through the fft and then the inverse fft. The code program follows.

I note that usually when you do something stupid with an FFT you will get symettrical affects that indicate a mistake. But this is truly random. I hope its something obvious like Im reaching out of memory and hopefully not an issue with cuda floating point accuracy or something.

Any ideas please!

This is being run with cuda 2.2 and a GTX280M chip. But the problem is the same on a FX1600M.



Ah, solved it. Need to divide all the input parameters by the total size to normalized the image before the fft.
So no real issue here.