cufft error

I’m new in CUDA programming and I’m using MS VS2008 and cufft library.

I tried to run solution which contains this scrap of code:

cufftHandle abc;

cufftResult res1=cufftPlan1d(&abc, 128, CUFFT_Z2Z, 1);

and in “res1” I have still error 0x4: CUFFT_INVALID_VALUE.

I tried to run my application on various types of CUDA hardware, on winxp64 and Windows 7x64. I tried to run only mexw64 library with matlab and also winapi in VS2010. I used cufft 3.2 and 4.0 (for x64 system). And I had still the same error. Compiler give no errors (but in VS2010, if I make a new .cu file to changing CUDA settings in Solution properties, I have “error 2” - I’ve readed that the reason of this is that cufft not supports VS2010 correctly).

I checked my mexw library by Dependency Walker and there were no errors. Cufft error 0x4 is still the same, if I’m running my aplicattion on software without CUDA.

Where should I search the fault?

i believe the last parameter you are using might be deprecated in version 3.2 and 4.0. see cufft.h:

cufftResult CUFFTAPI cufftPlan1d(cufftHandle *plan, 

                                 int nx, 

                                 cufftType type, 

                                 int batch /* deprecated - use cufftPlanMany */);

I tried this:

cufftResult wynik1=cufftPlanMany(&abc, 1, 32, NULL, 1, 0, NULL, 1, 0, CUFFT_C2C, 1);

and I have still the same error 4.

If your batch is just one, take off that parameter in the first code snippet you posted. No need to use planMany

Should I write that? :

cufftResult res1=cufftPlan1d(&abc, 128, CUFFT_Z2Z);

With this code I have error “too few arguments in function call”.

oops - this actually brings you back to square one …
could you upload your zipped solution and I’ll try to run it on my machine.
that’ll tell us if it’s something in your code or in the installation on your machine.

Err - oops, I was thinking of C2R. Anyway, have you checked to make sure your plan was created succesfully?

I have a question, i’m using cufft too, but i have theses errors :

whereas i do include cufft.h (I even tried to copy it in my project folder …)

Do you know where it could come from ?

these are link errors not compilation errors, so they have nothing to do with cufft.h.

what you are probably missing is the cufft.lib in your linker input. (in VS: Project Properties->Linker->Input->Additional Dependencies)

That’s it, thank you !