mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-24 14:45:14 +08:00
sign(complex) compiles for GPU
This commit is contained in:
parent
46d2f6cd78
commit
22dd368ea0
@ -676,8 +676,13 @@ struct scalar_sign_op<Scalar,true> {
|
||||
EIGEN_EMPTY_STRUCT_CTOR(scalar_sign_op)
|
||||
EIGEN_DEVICE_FUNC inline const Scalar operator() (const Scalar& a) const
|
||||
{
|
||||
typename NumTraits<Scalar>::Real aa = std::abs(a);
|
||||
return (aa==0) ? Scalar(0) : (a/aa);
|
||||
using std::abs;
|
||||
typedef typename NumTraits<Scalar>::Real real_type;
|
||||
real_type aa = abs(a);
|
||||
if (aa==0)
|
||||
return Scalar(0);
|
||||
aa = 1./aa;
|
||||
return Scalar(real(a)*aa, imag(a)*aa );
|
||||
}
|
||||
//TODO
|
||||
//template <typename Packet>
|
||||
|
Loading…
Reference in New Issue
Block a user