I am a new user of PGI Fortran. I need to do fft on GPU. I used fftw before, and I do not know what should I use if I want to run fft on GPU. Someone said I can use CUFFT but I do not know how to start. Any good articles, examples or suggestions about fft?
Hi hzhcapricorn,
While this article focuses on CUBLAS, CULA, and MAGMA, you should be able to apply similar methods to CUFFT.
Let me know if you have any questions!
Mat
Thanks. But I still want to know if I can use fftw in GPU?
Are you asking if you can call a fftw routine from within an accelerator region? Function calls are not yet supported on a GPU unless the routine can be in-lined. This a general restriction in GPU program since there isn’t a linker for device code nor hardware support. This may change in the future, though.
Of course, you could implement your own FFT within an Accelerator region. That would be fine.
- Mat
Does that mean even if I used functions of cufft within an accelerator region, I can still not run that on GPU?
While the CUFFT library does utilize a GPU in solving ffts, it can only be called from host code. So, no it can not be called from any device code including device code generated from an Accelerator region.
Here’s an example of calling CUFFT from CUDA Fortran: CUDA Musing: Calling CUFFT from Cuda Fortran
Can you please explain more about what you’re trying to do? Maybe we can find a solution. A small example code would help.
Thanks,
Mat
I cannot open your last link…
I am trying to simply use fft in calculation, but I do not know:
-
how to call cufft in my code, like which module to use or which file to include? Here I need a example.
-
how to compile, maybe use “pgfortran -I/opt/cuda2.3/include -L -L/opt/cuda2.3/lib64 source.c -lcufft”?
-
If I use cufft, do I need to do other things to run it on GPU? (like use !$acc region?)
It’s OK. I opened the link. The Great Fire Wall does not allow me to open that in China, so I find help from US. Thanks a lot!