FFTW to CUFFT

Hello. I’m have a C code that work with FFTW but now I’m trying to use CUFFT, but it doesn’t work. I’m having problems with those functions:

  • (double*) malloc(sizeof(double) * nos);
  • plan_forward1 = fftw_plan_dft_r2c_1d(nos, in1, reinterpret_cast(out1), FFTW_ESTIMATE);
  • fin1 = (double *) fftw_malloc(sizeof(double) * nos);
  • plan_backward1 = fftw_plan_dft_c2r_1d(nos, reinterpret_cast(out1), fin1, FFTW_ESTIMATE);
  • fftw_execute(plan_forward1);
  • fftw_execute(plan_backward1);
  • fftw_destroy_plan(plan_forward1);
  • fftw_free(in1);

Please, I need suggestions to solve my problem. I’m working with Visual Studio.

Thanks

What is the problem with those functions? You need to replace them by the appropriate cufft functions.
Note that there is no 1-to-1 correspondence between cufft and fftw fucntions. For example you do not need to define 2 plans for forward and backward transformation in cufft. It is an option to cufftExecX2X.

Check the examples in the documentation http://docs.nvidia.com/cuda/cufft/index.html.