FFT library

Hello all. Does PGI have a FFT library/functions? The PGI Compiler Guide states ‘highly optimized assembly-coded versions of BLAS and certain FFT routines may be available for your platform’. I do not know where to find these routines if I do have them.
I’m using Windows platform PGI Workstation.

Thanks
BL

Hi BL,

We include AMD’s ACML library which has several FFT routines. For more information, please refer to the ACML Reference manual (acml.pdf) in your PGI doc directory.

Hope this helps,
Mat

Thanks Mat. Are there any FFT routines that are for Fortran and use the NVIDIA GPU to do the calculation? Or is the CUFFT library the only one that can be used?

Thanks
BL

CUFFT is the only GPU enabled FFT library I know of but there could be others.

  • Mat

Ok. I am trying to do the example found at the following link that you posted earlier:
http://cudamusing.blogspot.com/2010/05/calling-cufft-from-cuda-fortran.html

I am not sure what the complete command would be on the command line to compile the code.

I am using PGI Workstation on Windows Server 2008 and Microsoft Visual Studio. I try to compile the following but I am not sure how to link the cufft library:

>pgfortran precision.f90 cufft.f90 fft_test.f90 -o main -Mcuda -lcufft

and I get the following message:

precision.f90:
cufft.f90:
fft_test.f90:
LINK : fatal error LNK1104: cannot open file 'libcufft.lib'

This is the path for the cufft library and PGI files
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64
C:\Program Files\PGI\win64\11.1

Thanks for the help.
BL

Hi BL,

You need to add the “-L<path/to/lib/dir>” flag to tell the compiler where the libcufft.lib library is located.

  • Mat

Thank you Mat. Could you please check the syntax of my command. I am still fairly new at this and have never linked libraries or modules before.

>pgfortran precision.f90 cufft.f90 fft_test.f90 -o main -Mcuda -L\c\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64 -lcufft

I get the following message:

precision.f90:
cufft.f90:
fft_test.f90:
File with unknown suffix passed to linker: Files\NVIDIA
File with unknown suffix passed to linker: GPU
File with unknown suffix passed to linker: Computing
File with unknown suffix passed to linker: Toolkit\CUDA\v3.2\lib\x64
LINK : fatal error LNK1181: cannot open input file 'Files\NVIDIA.obj'

I apologize for such a simple question.

The paths for the files are:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64
C:\Program Files\PGI\win64\11.1

Thank you
BL

Hi BL,

Since there are spaces in the lib directory path, you need to quote it:

pgfortran precision.f90 cufft.f90 fft_test.f90 -o main -Mcuda -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64" -lcufft
  • Mat

Thanks Mat. That got rid of those errors!
However, I get a ‘cannot open file’ message.

>pgfortran precision.f90 cufft.f90 fft_test.f90 -o main -Mcuda=cuda3.2 -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64" -lcufft
precision.f90:
cufft.f90:
fft_test.f90:
LINK : fatal error LNK1104: cannot open file 'libcufft.lib'

Is there something wrong with the library or am I doing something else incorrectly?

Thank you
BL

Hi BL,

Can you look in the “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64” directory to see what the name of the library is? It could be called “cufft.lib” in which case replace:

-L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64" -lcufft

with

"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64\cufft.lib"
  • Mat

Thank you Mat! That was the problem.

Regards
BL