I have been starting at this code for ages, and couldn’t figure out what is wrong with it.
Basically, I am trying to write a simple ifft function for to compare with the ifft function in MATLAB. The code works fine with 1D data (1x 1024) with and without padding. However, it spits out weird answers when I try a 2D data (as in 2x 1024 matrix). To clarify here, I want to use the batch capability to do 2 ifft in parallel.
I have written my code as follow:
[codebox] cufftPlan1d(&plan, N, CUFFT_C2C, M) ;
cufftExecC2C(plan, rhs_complex_d, rhs_complex_d, CUFFT_INVERSE) ;[/codebox]
where N = 1024, M = 2. But somehow I just couldn’t get the result to agree with the MATLAB result, which I know is correct.
I have attached a copy of my code, which is based on the ifft2_cuda.c example that came with the MATLAB plugin. Also, I have attached a picture showing the two results: the top being what it supposes to look like, and bottom being what I am getting with the above code.
Any suggestions or helps are much appreciated!!
ifft_cuda.txt (6.03 KB)