diff options
author | Antonio Sanchez <cantonios@google.com> | 2020-12-02 14:00:57 -0800 |
---|---|---|
committer | Antonio Sanchez <cantonios@google.com> | 2020-12-04 10:16:29 -0800 |
commit | e2f21465fea76a80966f12a20d0be36597f19b44 (patch) | |
tree | 1ae9b0e3ae489b028902166a343f796d196fde82 /Eigen/src/Core/arch/NEON/PacketMath.h | |
parent | 305b8bd2777bda99f65791468f305b76021bf579 (diff) |
Special function implementations for half/bfloat16 packets.
Current implementations fail to consider half-float packets, only
half-float scalars. Added specializations for packets on AVX, AVX512 and
NEON. Added tests to `special_packetmath`.
The current `special_functions` tests would fail for half and bfloat16 due to
lack of precision. The NEON tests also fail with precision issues and
due to different handling of `sqrt(inf)`, so special functions bessel, ndtri
have been disabled.
Tested with AVX, AVX512.
Diffstat (limited to 'Eigen/src/Core/arch/NEON/PacketMath.h')
-rw-r--r-- | Eigen/src/Core/arch/NEON/PacketMath.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Eigen/src/Core/arch/NEON/PacketMath.h b/Eigen/src/Core/arch/NEON/PacketMath.h index fd6b4f137..b60f4143f 100644 --- a/Eigen/src/Core/arch/NEON/PacketMath.h +++ b/Eigen/src/Core/arch/NEON/PacketMath.h @@ -192,7 +192,9 @@ struct packet_traits<float> : default_packet_traits HasExp = 1, HasSqrt = 1, HasTanh = EIGEN_FAST_MATH, - HasErf = EIGEN_FAST_MATH + HasErf = EIGEN_FAST_MATH, + HasBessel = 0, // Issues with accuracy. + HasNdtri = 0 }; }; @@ -3321,7 +3323,9 @@ template<> struct packet_traits<bfloat16> : default_packet_traits HasExp = 1, HasSqrt = 0, HasTanh = EIGEN_FAST_MATH, - HasErf = EIGEN_FAST_MATH + HasErf = EIGEN_FAST_MATH, + HasBessel = 0, // Issues with accuracy. + HasNdtri = 0, }; }; @@ -3887,7 +3891,10 @@ struct packet_traits<Eigen::half> : default_packet_traits { HasCos = 0, HasLog = 0, HasExp = 0, - HasSqrt = 1 + HasSqrt = 1, + HasErf = EIGEN_FAST_MATH, + HasBessel = 0, // Issues with accuracy. + HasNdtri = 0, }; }; |