cufftcomplex.h 程序员 reference/Documentation

cufftcomplex.h Programmers reference/Documentation

我正在研究 cufft 实现,找不到对 cufftcomplex 函数的任何引用。我通过 google 找到了 cucomplex.h,但这对我没有帮助。具体来说,我想知道如何读出 cufftcomplex 结构的虚部和实部。

类型cufftComplexcuComplex其实是一样的。它记录在 cuFFT documentation 中。在 cufft.h 你会发现 typedef:

typedef cuComplex cufftComplex;

cuComplex.h中你会发现cuComplex确实是一个float2,即你可以用c.x读出实数值,用[=读出虚数值18=]。或者更好地使用 cuComplex.h.

中提供的函数 cuCrealf()cuCimagf()