8#ifndef EIGEN_NEON_UNARY_FUNCTORS_H
9#define EIGEN_NEON_UNARY_FUNCTORS_H
12#include "../../InternalHeaderCheck.h"
18#if EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC
23struct scalar_logistic_op<
Eigen::half> {
24 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::half operator()(
const Eigen::half& x)
const {
26 const scalar_logistic_op<float> float_op;
27 return Eigen::half(float_op(
float(x)));
30 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::half packetOp(
const Eigen::half& x)
const {
return this->operator()(x); }
32 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4hf packetOp(
const Packet4hf& x)
const {
33 const scalar_logistic_op<float> float_op;
34 return vcvt_f16_f32(float_op.packetOp(vcvt_f32_f16(x)));
37 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet8hf packetOp(
const Packet8hf& x)
const {
38 const scalar_logistic_op<float> float_op;
39 return vcombine_f16(vcvt_f16_f32(float_op.packetOp(vcvt_f32_f16(vget_low_f16(x)))),
40 vcvt_f16_f32(float_op.packetOp(vcvt_high_f32_f16(x))));
45struct functor_traits<scalar_logistic_op<
Eigen::half>> {
47 Cost = functor_traits<scalar_logistic_op<float>>::Cost,
48 PacketAccess = functor_traits<scalar_logistic_op<float>>::PacketAccess,
Namespace containing all symbols from the Eigen library.
Definition Core:137