diff options
author | Antonio Sanchez <cantonios@google.com> | 2021-02-05 12:17:34 -0800 |
---|---|---|
committer | Antonio Sanchez <cantonios@google.com> | 2021-02-05 12:17:34 -0800 |
commit | abcde69a79c35c118e156964a1b6fb75f1ea2adb (patch) | |
tree | e6060fb032723aa071bd91d44316235895837eae /Eigen/src/Core/functors | |
parent | f85038b7f3e9a0bd7d2bfbed96cc966863aeea57 (diff) |
Disable vectorized pow for half/bfloat16.
We are potentially seeing some accuracy issues with these. Ideally we
would hand off to `float`, but that's not trivial with the current
setup.
We may want to consider adding `ppow<Packet>` and `HasPow`, so
implementations can more easily specialize this.
Diffstat (limited to 'Eigen/src/Core/functors')
-rw-r--r-- | Eigen/src/Core/functors/BinaryFunctors.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Eigen/src/Core/functors/BinaryFunctors.h b/Eigen/src/Core/functors/BinaryFunctors.h index a3ec9e177..271608123 100644 --- a/Eigen/src/Core/functors/BinaryFunctors.h +++ b/Eigen/src/Core/functors/BinaryFunctors.h @@ -435,12 +435,14 @@ struct functor_traits<scalar_pow_op<Scalar,Exponent> > { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess = (!NumTraits<Scalar>::IsComplex && !NumTraits<Scalar>::IsInteger && packet_traits<Scalar>::HasExp && packet_traits<Scalar>::HasLog && - packet_traits<Scalar>::HasRound && packet_traits<Scalar>::HasCmp) + packet_traits<Scalar>::HasRound && packet_traits<Scalar>::HasCmp && + // Temporarly disable packet access for half/bfloat16 until + // accuracy is improved. + !is_same<Scalar, half>::value && !is_same<Scalar, bfloat16>::value + ) }; }; - - //---------- non associative binary functors ---------- /** \internal |