cuFFT for Fast Fourier Transformation in GPU

The cuFFT library provides GPU accelerated operations for the FFT (short for, Fast Fourier Transform) algorithm. The programmers can transform real or complex data using GPU computing power, and apply GPU kernel operations for the transformed signal. Also, the supported functions are matched with the FFTW library, so we can migrate the host project to the GPU.

To handle the FFT sample's dimensional information, cuFFT is required to create a plan handle using cufftPlan1D(), cufftPlan2D(), or cufftPlan3D(), accordingly. If sample data has a batched and stride layout, we should use cufftPlanMany(). If the sample size is greater than 4 GB, we should use 64 as a suffix to the plan functions to support that size. For example, cufftPlanMany64() supports larger samples on top of the cufftPlanMany() function.

The cuFFT library supports multi-GPU operations. First, you need to create an empty plan using cufftCreate(). Then, we can specify the list of GPUs that will carry out the operation using cufftXtSetGPUs(). After that, we can generate a plan using normal plan generation functions, which we have previously covered. The following table shows the plan generation function categories:

Basic plans Multi-GPU plans
Simple plan cufftPlan{1d,2d,3d}() cufftMakePlan{1d,2d,3d}()
Advanced data layout cufftPlanMany() cufftMakePlanMany()
FP16 operation  cufftXtMakePlanMany()

 

Then you can forward (FFT) and inverse (IFFT) to your sample data using the cufftExec() function. The cuFFT library provides three kinds of data transformation: complex-to-complex, real-to-complex, and complex-to-real. Its operation data type can be a float or a double:

Transform direction Float Double
Complex-to-complex cufftExecC2C()
cufftXtExecDescriptorC2C()
cufftExecZ2Z()
cufftXtExecDescriptorZ2Z()
Real-to-complex cufftDExecR2C()
cufftXtExecDescriptorR2C()
cufftExecD2Z()
cufftXtExecDescriptorD2Z()
Complex-to-real cufftExecC2R()
cufftXtExecDescriptorC2R()
cufftExecZ2D()
cufftXtExecDesciptorZ2D()
All cufftXtExec() / cufftXtExecDesciptor()

 

The cuFFT operation is either forward or inverse, and the operation should be paired with the other direction.

The functions that transform between the real data and the complex data, such as R2C and C2R, have implicit directional information in their function name. This feature helps you to avoid having to have an additional operation in order to convert your data in the real domain to a complex data type. Meanwhile, you have to create an additional plan since each plan has transformation direction information.

On the other hand, you have to provide the transform direction information for the complex-to-complex transformation, such as C2C and Z2Z. For the inversion operation, you don't have to create another cuFFT handle, because the plan should be the same data type operation.

The cufftXtExec() and cufftXtExecDescriptor() functions can perform transformation on any given data type, since every input data should be provided with their data type information when you create a cuFFT plan. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.19.31.73