mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Fix broken packetmath test for logistic on Arm.
This commit is contained in:
parent
537e2b322f
commit
c2ab36f47a
@ -524,7 +524,8 @@ template<typename Packet> EIGEN_DEVICE_FUNC inline bool predux_any(const Packet&
|
|||||||
// - bits full of ones (NaN for floats),
|
// - bits full of ones (NaN for floats),
|
||||||
// - or first bit equals to 1 (1 for ints, smallest denormal for floats).
|
// - or first bit equals to 1 (1 for ints, smallest denormal for floats).
|
||||||
// For all these cases, taking the sum is just fine, and this boils down to a no-op for scalars.
|
// For all these cases, taking the sum is just fine, and this boils down to a no-op for scalars.
|
||||||
return bool(numext::not_equal_strict(predux(a), pzero(a)));
|
typedef typename unpacket_traits<Packet>::type Scalar;
|
||||||
|
return numext::not_equal_strict(predux(a), Scalar(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \internal \returns the reversed elements of \a a*/
|
/** \internal \returns the reversed elements of \a a*/
|
||||||
|
@ -447,18 +447,20 @@ template<typename Scalar,typename Packet> void packetmath_real()
|
|||||||
VERIFY((numext::isnan)(data2[0]));
|
VERIFY((numext::isnan)(data2[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (PacketTraits::HasExp) {
|
||||||
internal::scalar_logistic_op<Scalar> logistic;
|
internal::scalar_logistic_op<Scalar> logistic;
|
||||||
for (int i=0; i<size; ++i)
|
for (int i=0; i<size; ++i)
|
||||||
{
|
{
|
||||||
data1[i] = internal::random<Scalar>(-20,20);
|
data1[i] = internal::random<Scalar>(-20,20);
|
||||||
}
|
}
|
||||||
internal::pstore(data2, logistic.packetOp(internal::pload<Packet>(data1)));
|
|
||||||
|
test::packet_helper<PacketTraits::HasExp,Packet> h;
|
||||||
|
h.store(data2, logistic.packetOp(h.load(data1)));
|
||||||
for (int i=0; i<PacketSize; ++i) {
|
for (int i=0; i<PacketSize; ++i) {
|
||||||
VERIFY_IS_APPROX(data2[i],logistic(data1[i]));
|
VERIFY_IS_APPROX(data2[i],logistic(data1[i]));
|
||||||
#ifdef EIGEN_VECTORIZE // don't check for exactness when using the i387 FPU
|
#ifdef EIGEN_VECTORIZE // don't check for exactness when using the i387 FPU
|
||||||
VERIFY_IS_EQUAL(data2[i],logistic(data1[i]));
|
VERIFY_IS_EQUAL(data2[i],logistic(data1[i]));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user