简体   繁体   English

CUFFT具有双精度

[英]CUFFT with double precision

I am experiencing some problems with CUDAs FFT library. 我在使用CUDA FFT库时遇到一些问题。

I declared the inputs as cuDoubleComplex, but the compiler returns the error that this type is incompatible with parameters of type cufftComplex. 我将输入声明为cuDoubleComplex,但是编译器返回以下错误:此类型与cufftComplex类型的参数不兼容。 After some search through the Internet, I found the file cufft.h, in which there is the line typedef cuComplex cufftComplex; 通过Internet进行搜索后,我找到文件cufft.h,其中包含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. 我的问题是,在cuComplex.h库中,很显然cuComplex具有单浮点精度( typedef cuFloatComplex cuComplex; ),但是我想要双精度。

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);

The double precision complex data type is defined as cufftDoubleComplex in CUFFT. 双精度复杂数据类型在CUFFT中定义为cufftDoubleComplex

Double precision versions of fft in CUFFT are: CUFFT中fft的双精度版本是:

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 . cufftExecC2C是fft的单精度版本,并且期望输入和输出指针的类型为cufftComplex ,而您要cufftComplex传递的类型为cufftDoubleComplex的指针。

For cufftDoubleComplex data type, you have to use the function cufftExecZ2Z instead, which is for double precision data. 对于cufftDoubleComplex数据类型,必须改为使用函数cufftExecZ2Z ,该函数用于双精度数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM