Fix warnings in ptrue for complex and half types.

This commit is contained in:
Rasmus Munk Larsen
2019-01-11 14:10:57 -08:00
parent 1e6d15b55b
commit 89c4001d6f
2 changed files with 12 additions and 1 deletions

View File

@@ -218,6 +218,13 @@ pandnot(const Packet& a, const Packet& b) { return a & (~b); }
template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
ptrue(const Packet& /*a*/) { Packet b; memset(&b, 0xff, sizeof(b)); return b;}
template <typename RealScalar>
EIGEN_DEVICE_FUNC inline std::complex<RealScalar> ptrue(const std::complex<RealScalar>& /*a*/) {
RealScalar b;
b = ptrue(b);
return std::complex<RealScalar>(b, b);
}
/** \internal \returns the bitwise not of \a a */
template <typename Packet> EIGEN_DEVICE_FUNC inline Packet
pnot(const Packet& a) { return pxor(ptrue(a), a);}