Hi!

I’m porting a Matlab application to CUDA. I need to calculate FFT by cuFFT library, but results between Matlab fft() and CUDA fft are different. I’ve seen around this forum ( http://forums.nvidia.com/index.php?showtop…mp;#entry589016 ) and others, that the problems resides in a different representation of matrix (row-major orderin CUDA vs column-major order in Matlab) and in a different representation of complex values (in CUDA we have a Array of Struct, while in Matlab we have a Struct of Array). The Matlab instruction that I’m trying to convert:

```
% A is a 1013*256-matrix
% B will be a 1024*256-matrix
B = fft(A, 1024, 1);
```

So I’ve made these trials:

- n-point cudaFFT on A in 1-dimension

```
cufftHandle plan;
cudaPlan1d(&plan,1024*256,CUFFT_C2C,1);
cufftExecC2C(plan,A,B,CUFFT_FORWARD);
```

- cudaFFT on A in 2-dimension

```
cufftHandle plan;
cudaPlan2d(&plan,1024,256,CUFFT_C2C);
cufftExecC2C(plan,A,B,CUFFT_FORWARD);
```

- n-point cudaFFT on A^t (the transpose of A) in 1-dimension

```
cufftHandle plan;
cudaPlan1d(&plan,1024*256,CUFFT_C2C,1);
cufftExecC2C(plan,At,B,CUFFT_FORWARD);
```

- cudaFFT on A in 2-dimension with args N and M swapped

```
cufftHandle plan;
cudaPlan2d(&plan,256,1024,CUFFT_C2C);
cufftExecC2C(plan,A,B,CUFFT_FORWARD);
```

None of these gave me results more or less equals to Matlab fft(). What can I do?