diff options
author | Rasmus Munk Larsen <rmlarsen@google.com> | 2020-11-24 20:53:07 +0000 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2020-11-24 20:53:07 +0000 |
commit | c770746d709686ef2b8b652616d9232f9b028e78 (patch) | |
tree | 624821fa175d8f40cc13886d7483ffd35e9da1e3 /Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h | |
parent | 22f67b59585805fedf86759f7013b2b670f83386 (diff) |
Fix Half NaN definition and test.
The `half_float` test was failing with `-mcpu=cortex-a55` (native `__fp16`) due
to a bad NaN bit-pattern comparison (in the case of casting a float to `__fp16`,
the signaling `NaN` is quieted). There was also an inconsistency between
`numeric_limits<half>::quiet_NaN()` and `NumTraits::quiet_NaN()`. Here we
correct the inconsistency and compare NaNs according to the IEEE 754
definition.
Also modified the `bfloat16_float` test to match.
Tested with `cortex-a53` and `cortex-a55`.
Diffstat (limited to 'Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h')
-rw-r--r-- | Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h index 0e02a1b20..cc6fc5ac7 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h @@ -70,8 +70,15 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet pcos_float(const Packet& x); +/** \internal \returns sqrt(x) for complex types */ +template<typename Packet> +EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +EIGEN_UNUSED +Packet psqrt_complex(const Packet& x); + template <typename Packet, int N> struct ppolevl; + } // end namespace internal } // end namespace Eigen |