Vectorize fp16 tanh and logistic functions on Neon

Activates vectorization of the Eigen::half versions of the tanh and
logistic functions when they run on Neon. Both functions convert their
inputs to float before computing the output, and as a result of this
commit, the conversions and the computation in float are vectorized.
This commit is contained in:
Alex Druinsky
2021-10-26 12:24:33 -07:00
committed by Rasmus Munk Larsen
parent 185ad0e610
commit 6bb6a6bf53
4 changed files with 89 additions and 0 deletions

View File

@@ -4028,6 +4028,7 @@ struct packet_traits<Eigen::half> : default_packet_traits {
HasCos = 0,
HasLog = 0,
HasExp = 0,
HasTanh = packet_traits<float>::HasTanh, // tanh<half> calls tanh<float>
HasSqrt = 1,
HasRsqrt = 1,
HasErf = EIGEN_FAST_MATH,