[SOLVED] cuComplex.cu and

I was checking cuComplex.h and it looks like it doesn’t have a macro like _Complex_I, or _Imaginary_I, or just I, that can be accessed in the device.

Do you guys normally just pass the sqrt(-1) as an argument to your kernel function and do the multiplication yourselves, or cuCimag() already returns the imaginary part of a cufftComplex multiplied by I?

I’m confused. Isn’t i just:



cuCimag() definitely does not return the imaginary part of a cufftComplex multiplied by i. It returns the imaginary part. Period.

A complex number is expressed as a+bi

in that context, we produce a complex number c by:

c = make_cuFloatComplex(a,b)

cuCimag© returns b (not b*i, or anything else)

i is the same as 0+i

therefore a = 0, and b = 1. We can create that number by:


Thanks for the clarification, Robert.
I will stick to make_cuFloatComplex() then.