diff options
author | Rasmus Munk Larsen <rmlarsen@google.com> | 2019-01-11 14:10:57 -0800 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2019-01-11 14:10:57 -0800 |
commit | 89c4001d6f5136fd2702258e4fa754be31d682a1 (patch) | |
tree | 5c5ba7c0d0d33a00f475f89b0a1c6ba4bc447218 | |
parent | 1e6d15b55b67d6170d4548fa7f20acbb327814bf (diff) |
Fix warnings in ptrue for complex and half types.
-rw-r--r-- | Eigen/src/Core/GenericPacketMath.h | 7 | ||||
-rw-r--r-- | Eigen/src/Core/arch/GPU/PacketMathHalf.h | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h index 95c4e4027..bb3275fe8 100644 --- a/Eigen/src/Core/GenericPacketMath.h +++ b/Eigen/src/Core/GenericPacketMath.h @@ -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);} diff --git a/Eigen/src/Core/arch/GPU/PacketMathHalf.h b/Eigen/src/Core/arch/GPU/PacketMathHalf.h index 00e40d40b..eab7be14c 100644 --- a/Eigen/src/Core/arch/GPU/PacketMathHalf.h +++ b/Eigen/src/Core/arch/GPU/PacketMathHalf.h @@ -143,10 +143,14 @@ template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pabs<half2>(const half2& return result; } +template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half ptrue<half>(const half& a) { + return __half_raw(0xffffu); +} + template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 ptrue<half2>(const half2& a) { half2 result; *(reinterpret_cast<unsigned*>(&(result))) = 0xffffffffu; -} +} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void ptranspose(PacketBlock<half2,2>& kernel) { |