繁体   English   中英

CUFFT具有双精度

[英]CUFFT with double precision

我在使用CUDA FFT库时遇到一些问题。

我将输入声明为cuDoubleComplex,但是编译器返回以下错误:此类型与cufftComplex类型的参数不兼容。 通过Internet进行搜索后,我找到文件cufft.h,其中包含typedef cuComplex cufftComplex; 我的问题是,在cuComplex.h库中,很显然cuComplex具有单浮点精度( typedef cuFloatComplex cuComplex; ),但是我想要双精度。

这可能吗?

特别是,我获得以下信息:

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

在这一行:

cufftExecC2C(plan, data1, data2, CUFFT_FORWARD);

双精度复杂数据类型在CUFFT中定义为cufftDoubleComplex

CUFFT中fft的双精度版本是:

cufftExecD2Z() //Real To Complex

cufftExecZ2D() //Complex To Real

cufftExecZ2Z() //Complex To Complex

cufftExecC2C是fft的单精度版本,并且期望输入和输出指针的类型为cufftComplex ,而您要cufftComplex传递的类型为cufftDoubleComplex的指针。

对于cufftDoubleComplex数据类型,必须改为使用函数cufftExecZ2Z ,该函数用于双精度数据。

暂无
暂无

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

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