diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h index 0e7dd29ed0..6872f5e530 100644 --- a/Eigen/src/Core/GenericPacketMath.h +++ b/Eigen/src/Core/GenericPacketMath.h @@ -43,7 +43,7 @@ struct default_packet_traits { enum { HasHalfPacket = 0, - + HasAdd = 1, HasSub = 1, HasMul = 1, @@ -76,7 +76,7 @@ struct default_packet_traits HasTanh = 0, HasLGamma = 0, HasErf = 0, - HasErfc = 0 + HasErfc = 0, HasRound = 0, HasFloor = 0, diff --git a/Eigen/src/Core/SpecialFunctions.h b/Eigen/src/Core/SpecialFunctions.h index d481f2e068..ae8f0105a6 100644 --- a/Eigen/src/Core/SpecialFunctions.h +++ b/Eigen/src/Core/SpecialFunctions.h @@ -1,7 +1,6 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. // -// Copyright (C) 2006-2010 Benoit Jacob // Copyright (C) 2015 Eugene Brevdo // // This Source Code Form is subject to the terms of the Mozilla @@ -45,14 +44,13 @@ template <> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double __erfc(double x } // end namespace internal /**************************************************************************** - * Implementations * + * Implementations * ****************************************************************************/ namespace internal { /**************************************************************************** - * Implementation of - * lgamma * + * Implementation of lgamma * ****************************************************************************/ template @@ -72,8 +70,7 @@ struct lgamma_retval }; /**************************************************************************** - * Implementation of - * erf * + * Implementation of erf * ****************************************************************************/ template @@ -92,8 +89,8 @@ struct erf_retval typedef Scalar type; }; -/**************************************************************************** -* Implementation of erfc * +/*************************************************************************** +* Implementation of erfc * ****************************************************************************/ template diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h index 27c7907fcf..483af876fb 100644 --- a/Eigen/src/Core/util/ForwardDeclarations.h +++ b/Eigen/src/Core/util/ForwardDeclarations.h @@ -294,12 +294,6 @@ struct stem_function }; } -// SpecialFunctions forward declarations -namespace internal { -template EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Scalar __lgamma(Scalar x); -template EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Scalar __erf(Scalar x); -template EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Scalar __erfc(Scalar x); - } // end namespace Eigen #endif // EIGEN_FORWARDDECLARATIONS_H diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 304fab5dec..c34b6f3f12 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -355,19 +355,19 @@ template void packetmath_real() data1[0] = std::numeric_limits::quiet_NaN(); packet_helper::HasLGamma,Packet> h; h.store(data2, internal::plgamma(h.load(data1))); - VERIFY(std::isnan(data2[0])); + VERIFY((numext::isnan)(data2[0])); } { data1[0] = std::numeric_limits::quiet_NaN(); packet_helper::HasErf,Packet> h; h.store(data2, internal::perf(h.load(data1))); - VERIFY(std::isnan(data2[0])); + VERIFY((numext::isnan)(data2[0])); } { data1[0] = std::numeric_limits::quiet_NaN(); packet_helper::HasErfc,Packet> h; h.store(data2, internal::perfc(h.load(data1))); - VERIFY(std::isnan(data2[0])); + VERIFY((numext::isnan)(data2[0])); } for (int i=0; i void packetmath_real() data1[i] = internal::random(0,1) * std::pow(Scalar(10), internal::random(-6,6)); data2[i] = internal::random(0,1) * std::pow(Scalar(10), internal::random(-6,6)); } + +#if __cplusplus > 199711L if(internal::random(0,1)<0.1) data1[internal::random(0, PacketSize)] = 0; CHECK_CWISE1_IF(PacketTraits::HasSqrt, std::sqrt, internal::psqrt); @@ -382,6 +384,7 @@ template void packetmath_real() CHECK_CWISE1_IF(internal::packet_traits::HasLGamma, std::lgamma, internal::plgamma); CHECK_CWISE1_IF(internal::packet_traits::HasErf, std::erf, internal::perf); CHECK_CWISE1_IF(internal::packet_traits::HasErfc, std::erfc, internal::perfc); +#endif if(PacketTraits::HasLog && PacketTraits::size>=2) {