cuComplexdefined in /usr/local/cuda/include/cuComplex.h(modulo your installation directory). Relevant fragments:
typedef float2 cuFloatComplex;
typedef cuFloatComplex cuComplex;
typedef double2 cuDoubleComplex;
There are also convenient functions for working with complex numbers - their multiplication, construction, etc.
As for using float2or cuComplex, should you use what is semantically suitable - is it a vector or a complex number? Also, if it is a complex number, you may want to use it cuFloatComplexor cuDoubleComplexjust to be completely explicit.
source
share