Lines 566-581
template<typename Scalar,typename Packet
Link Here
|
566 |
if (PacketTraits::HasTanh) { |
566 |
if (PacketTraits::HasTanh) { |
567 |
// NOTE this test migh fail with GCC prior to 6.3, see MathFunctionsImpl.h for details. |
567 |
// NOTE this test migh fail with GCC prior to 6.3, see MathFunctionsImpl.h for details. |
568 |
data1[0] = std::numeric_limits<Scalar>::quiet_NaN(); |
568 |
data1[0] = std::numeric_limits<Scalar>::quiet_NaN(); |
569 |
packet_helper<internal::packet_traits<Scalar>::HasTanh,Packet> h; |
569 |
packet_helper<internal::packet_traits<Scalar>::HasTanh,Packet> h; |
570 |
h.store(data2, internal::ptanh(h.load(data1))); |
570 |
h.store(data2, internal::ptanh(h.load(data1))); |
571 |
VERIFY((numext::isnan)(data2[0])); |
571 |
VERIFY((numext::isnan)(data2[0])); |
572 |
} |
572 |
} |
573 |
|
573 |
|
|
|
574 |
{ |
575 |
internal::scalar_logistic_op<Scalar> logistic; |
576 |
for (int i=0; i<size; ++i) |
577 |
{ |
578 |
data1[i] = internal::random<Scalar>(-20,20); |
579 |
} |
580 |
internal::pstore(data2, logistic.packetOp(internal::pload<Packet>(data1))); |
581 |
for (int i=0; i<PacketSize; ++i) { |
582 |
VERIFY_IS_APPROX(data2[i],logistic(data1[i])); |
583 |
#ifdef EIGEN_VECTORIZE // don't check for exactness when using the i387 FPU |
584 |
VERIFY_IS_EQUAL(data2[i],logistic(data1[i])); |
585 |
#endif |
586 |
} |
587 |
} |
588 |
|
574 |
#if EIGEN_HAS_C99_MATH |
589 |
#if EIGEN_HAS_C99_MATH |
575 |
{ |
590 |
{ |
576 |
data1[0] = std::numeric_limits<Scalar>::quiet_NaN(); |
591 |
data1[0] = std::numeric_limits<Scalar>::quiet_NaN(); |
577 |
packet_helper<internal::packet_traits<Scalar>::HasLGamma,Packet> h; |
592 |
packet_helper<internal::packet_traits<Scalar>::HasLGamma,Packet> h; |
578 |
h.store(data2, internal::plgamma(h.load(data1))); |
593 |
h.store(data2, internal::plgamma(h.load(data1))); |
579 |
VERIFY((numext::isnan)(data2[0])); |
594 |
VERIFY((numext::isnan)(data2[0])); |
580 |
} |
595 |
} |
581 |
if (internal::packet_traits<Scalar>::HasErf) { |
596 |
if (internal::packet_traits<Scalar>::HasErf) { |
Lines 960-976
struct runner<Scalar,PacketType,false,fa
Link Here
|
960 |
runall<Scalar,PacketType>::run(); |
975 |
runall<Scalar,PacketType>::run(); |
961 |
} |
976 |
} |
962 |
}; |
977 |
}; |
963 |
|
978 |
|
964 |
EIGEN_DECLARE_TEST(packetmath) |
979 |
EIGEN_DECLARE_TEST(packetmath) |
965 |
{ |
980 |
{ |
966 |
g_first_pass = true; |
981 |
g_first_pass = true; |
967 |
for(int i = 0; i < g_repeat; i++) { |
982 |
for(int i = 0; i < g_repeat; i++) { |
968 |
|
|
|
969 |
CALL_SUBTEST_1( runner<float>::run() ); |
983 |
CALL_SUBTEST_1( runner<float>::run() ); |
970 |
CALL_SUBTEST_2( runner<double>::run() ); |
984 |
CALL_SUBTEST_2( runner<double>::run() ); |
971 |
CALL_SUBTEST_3( runner<int>::run() ); |
985 |
CALL_SUBTEST_3( runner<int>::run() ); |
972 |
CALL_SUBTEST_4( runner<std::complex<float> >::run() ); |
986 |
CALL_SUBTEST_4( runner<std::complex<float> >::run() ); |
973 |
CALL_SUBTEST_5( runner<std::complex<double> >::run() ); |
987 |
CALL_SUBTEST_5( runner<std::complex<double> >::run() ); |
974 |
CALL_SUBTEST_6(( packetmath<half,internal::packet_traits<half>::type>() )); |
988 |
CALL_SUBTEST_6(( packetmath<half,internal::packet_traits<half>::type>() )); |
975 |
g_first_pass = false; |
989 |
g_first_pass = false; |
976 |
} |
990 |
} |