cuComplex.h不支持exp()函数,因此需要自己写
__host__ __device__
cuFloatComplex my_complex_exp (cuFloatComplex arg)
{
cuFloatComplex res;
float s, c;
float e = expf(arg.x);
sincosf(arg.y, &s, &c);
res.x = c * e;
res.y = s * e;
return res;
}
cuFloatComplex my_complex_exp (cuFloatComplex arg)
{
cuFloatComplex res;
float s, c;
float e = expf(arg.x);
sincosf(arg.y, &s, &c);
res.x = c * e;
res.y = s * e;
return res;
}
参考: