When using Visual studio, click right button on your project name. Then click on properties.
Then configuration properties, linker, input. In additional dependencies you must write cufft.lib.
In Mathematical Methods of Physics, a Poisson quation can be solved using Fourier transform (or Laplace tranform)
Firstly, include headfile for FFT
#include <cuda.h>
#include <cufft.h>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
cufftHandle plan; // create cuFFT handle
cufftPlan1d(&plan, N, CUFFT_C2C, BATCH); // N here is the length of data, CUFFT_C2C is from complex to complex; Batch execution for multiple transforms,or use cufftPlanMany() instead.
cufftExecC2C(plan, data_dev, data_dev, CUFFT_FORWARD); //the first data_dev is the address of input data, and the second data_dev is address of output data result
// excute cuFFT with forwad FFT, CUFFT_INVERSE is inverse FFT.Watch out: InverseFFT needs to be diveded by N after execution.