File indexing completed on 2025-01-19 09:52:55
0001 #ifndef EIGEN_NEON_SPECIALFUNCTIONS_H
0002 #define EIGEN_NEON_SPECIALFUNCTIONS_H
0003
0004 namespace Eigen {
0005 namespace internal {
0006
0007 #if EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC
0008
0009 #define NEON_HALF_TO_FLOAT_FUNCTIONS(METHOD) \
0010 template <> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
0011 Packet8hf METHOD<Packet8hf>(const Packet8hf& x) { \
0012 const Packet4f lo = METHOD<Packet4f>(vcvt_f32_f16(vget_low_f16(x))); \
0013 const Packet4f hi = METHOD<Packet4f>(vcvt_f32_f16(vget_high_f16(x))); \
0014 return vcombine_f16(vcvt_f16_f32(lo), vcvt_f16_f32(hi)); \
0015 } \
0016 \
0017 template <> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
0018 Packet4hf METHOD<Packet4hf>(const Packet4hf& x) { \
0019 return vcvt_f16_f32(METHOD<Packet4f>(vcvt_f32_f16(x))); \
0020 }
0021
0022 NEON_HALF_TO_FLOAT_FUNCTIONS(perf)
0023 NEON_HALF_TO_FLOAT_FUNCTIONS(pndtri)
0024
0025 #undef NEON_HALF_TO_FLOAT_FUNCTIONS
0026 #endif
0027
0028 BF16_PACKET_FUNCTION(Packet4f, Packet4bf, perf)
0029 BF16_PACKET_FUNCTION(Packet4f, Packet4bf, pndtri)
0030
0031 }
0032 }
0033
0034 #endif