mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
Fix warnings in ptrue for complex and half types.
This commit is contained in:
parent
1e6d15b55b
commit
89c4001d6f
@ -218,6 +218,13 @@ pandnot(const Packet& a, const Packet& b) { return a & (~b); }
|
|||||||
template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
|
template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
|
||||||
ptrue(const Packet& /*a*/) { Packet b; memset(&b, 0xff, sizeof(b)); return b;}
|
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 */
|
/** \internal \returns the bitwise not of \a a */
|
||||||
template <typename Packet> EIGEN_DEVICE_FUNC inline Packet
|
template <typename Packet> EIGEN_DEVICE_FUNC inline Packet
|
||||||
pnot(const Packet& a) { return pxor(ptrue(a), a);}
|
pnot(const Packet& a) { return pxor(ptrue(a), a);}
|
||||||
|
@ -143,10 +143,14 @@ template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pabs<half2>(const half2&
|
|||||||
return result;
|
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) {
|
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 ptrue<half2>(const half2& a) {
|
||||||
half2 result;
|
half2 result;
|
||||||
*(reinterpret_cast<unsigned*>(&(result))) = 0xffffffffu;
|
*(reinterpret_cast<unsigned*>(&(result))) = 0xffffffffu;
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void
|
||||||
ptranspose(PacketBlock<half2,2>& kernel) {
|
ptranspose(PacketBlock<half2,2>& kernel) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user