Hi I have the following test code for the CUFFT in 2D

```
void pprFFT(pprMatrix *matrix, pprComplexMatrix *cmatrix)
{
cufftHandle plan;
cufftReal in[matrix->row*matrix->col],indev[matrix->row*matrix->col];
cufftComplex *out,*outd;
int i,j;
out=(cufftComplex*)malloc(sizeof(cufftComplex)*matrix->col*matrix->row);
cmatrix->row = matrix->row;
cmatrix->col = matrix->col;
pprComplexMatrixMem(cmatrix);
in[0]=1;
in[1]=2;
in[2]=3;
in[3]=4;
cudaMalloc((void**)&outd, sizeof(cufftComplex)*4);
cudaMalloc((void**)&indev, sizeof(cufftReal)*4);
cudaMemcpy(indev, in, sizeof(cufftReal)*4, cudaMemcpyHostToDevice);
cufftResult err1 = cufftPlan2d(&plan, 2, 2, CUFFT_R2C);
printf("%d\n", err1);
cufftResult err2 =cufftExecR2C(&plan, indev, outd);
printf("%d\n", err2);
cudaMemcpy(out, outd, sizeof(cufftComplex)*4, cudaMemcpyDeviceToHost);
cudaFree(outd);
for(i =0 ; i < 2 ; i++)
{
for(j =0 ; j < 2 ; j++)
{
cmatrix->data.real[i*2+j]=out[i*2+j].x;
cmatrix->data.imag[i*2+j]=out[i*2+j].y;
printf("data[%d] %f %f\n", i, out[i*2+j].x, out[i*2+j].y);
}
}
}
int main(int argc, char *argv[])
{
pprMatrix matrix;
pprComplexMatrix cmatrix;
int i,j;
matrix.row=2;
matrix.col=2;
pprMatrixMem(&matrix);
matrix.data[0]=1;
matrix.data[1]=2;
matrix.data[2]=3;
matrix.data[3]=4;
pprFFT(&matrix,&cmatrix);
printf("%f \n",cmatrix.data.real[0]);
printf("%f \n",cmatrix.data.real[1]);
printf("%f \n",cmatrix.data.real[2]);
printf("%f \n",cmatrix.data.real[3]);
}
```

But the result is all zeros. The error is in ExecR2C (CUFTT_EXEC_FAILED) but don’t know how to solve it, any ideas?

I have a vector with all the info of the image but I want to perform a 2D FFT with those values.