CUFFT with double precision

a 夏天 提交于 2019-12-13 16:34:05

问题


I am experiencing some problems with CUDAs FFT library.

I declared the inputs as cuDoubleComplex, but the compiler returns the error that this type is incompatible with parameters of type cufftComplex. After some search through the Internet, I found the file cufft.h, in which there is the line typedef cuComplex cufftComplex;. My problem is that in the library cuComplex.h it is clear that cuComplex has a single floating point precision (typedef cuFloatComplex cuComplex;), but I would like a double precision.

Is this possible?

In particular, I obtain the following:

error: argument of type "cufftDoubleComplex *" is incompatible with parameter of type "cufftComplex *"

at this line:

cufftExecC2C(plan, data1, data2, CUFFT_FORWARD);

回答1:


The double precision complex data type is defined as cufftDoubleComplex in CUFFT.

Double precision versions of fft in CUFFT are:

cufftExecD2Z() //Real To Complex

cufftExecZ2D() //Complex To Real

cufftExecZ2Z() //Complex To Complex

cufftExecC2C is the single precision version of fft, and expects the input and output pointers to be of type cufftComplex,whereas you are passing it a pointer of type cufftDoubleComplex.

For cufftDoubleComplex data type, you have to use the function cufftExecZ2Z instead, which is for double precision data.



来源:https://stackoverflow.com/questions/14120632/cufft-with-double-precision

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!