CUFFT replacing fftw3 in C++ compilation problem when CUFFT replacing fftw3 in C++

Hi all,

I have a code which is written in c++, it is using the fftw3 library.

To make it faster I am replacing fftw3 with CUFFT.

fftw3 and CUFFT are using variables and pointers for plan and complex from the same type.

based on the CUFFT Library manual last example (for 3d, c2c); I did not include the cudaMemcpy commands.

In addition I included the following headers in the code

#include <math.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cufft.h>

I set the linker and the search directories to point to the libcufft.so and the above include files

when I compile I have the following error generated:

Compiling: FFT_main.cpp
/…/cuda.h:547: error: expected ‘,’ or ‘…’ before numeric constant
/…/cuda.h:696: error: expected ‘,’ or ‘…’ before numeric constant

the first line (547) in cuda.h is under device management
CUresult CUDAAPI cuDeviceGetAttribute(int *pi, CUdevice_attribute attrib, CUdevice dev);

the second line (696) in cuda.h is under fuction management
CUresult CUDAAPI cuFuncGetAttribute (int *pi, CUfunction_attribute attrib, CUfunction hfunc);

any suggestions?

I Understand that everybody is busy developing their own code; so I decided to do a little more work.

I wrote a new code utilizing the CUFFT library and added the memory copy command to transfer the data from the host to device and back.

I implemented the code for 3d and it works fine. Therefor I made the necessary changes in the primary project I am doing and … I am still getting the same error! >.<

When I investigated more I found that the compiler pointing the error @ the int *pi part in the following line (listed above too)

CUresult CUDAAPI cuDeviceGetAttribute(int *pi, CUdevice_attribute attrib, CUdevice dev);

This applies for the second error too.

Any idea what this int *pi refers too?

Thanks for any suggestions.

Maybe you should try adjusting the include statements.

For my case, I wrap the calls with cutilSafeCall() or cufftSafeCall()s and I include cufft.h and cutil_inline.h, but not cuda.h or cuda_runtime.h and my code works fine.