NDDEM
MathFunctions.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // This Source Code Form is subject to the terms of the Mozilla
5 // Public License v. 2.0. If a copy of the MPL was not distributed
6 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 
8 #ifndef EIGEN_MATH_FUNCTIONS_NEON_H
9 #define EIGEN_MATH_FUNCTIONS_NEON_H
10 
11 namespace Eigen {
12 
13 namespace internal {
14 
16 { return pexp_float(x); }
18 { return pexp_float(x); }
19 
21 { return plog_float(x); }
23 { return plog_float(x); }
24 
26 { return psin_float(x); }
28 { return psin_float(x); }
29 
31 { return pcos_float(x); }
33 { return pcos_float(x); }
34 
35 // Hyperbolic Tangent function.
40 
46 
47 template <>
49  Packet4f fexponent;
50  const Packet4bf out = F32ToBf16(pfrexp<Packet4f>(Bf16ToF32(a), fexponent));
51  exponent = F32ToBf16(fexponent);
52  return out;
53 }
54 
55 template <>
57  return F32ToBf16(pldexp<Packet4f>(Bf16ToF32(a), Bf16ToF32(exponent)));
58 }
59 
60 //---------- double ----------
61 
62 #if EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG
64 { return pexp_double(x); }
65 
67 { return plog_double(x); }
68 
69 #endif
70 
71 } // end namespace internal
72 
73 } // end namespace Eigen
74 
75 #endif // EIGEN_MATH_FUNCTIONS_NEON_H
#define BF16_PACKET_FUNCTION(PACKET_F, PACKET_BF16, METHOD)
Definition: BFloat16.h:19
#define EIGEN_UNUSED
Definition: Macros.h:1067
#define EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
Definition: Macros.h:985
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
v2f64 Packet2d
Definition: PacketMath.h:820
EIGEN_STRONG_INLINE Packet8f Bf16ToF32(const Packet8bf &a)
Definition: PacketMath.h:1260
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f ptanh< Packet2f >(const Packet2f &x)
Definition: MathFunctions.h:36
eigen_packet_wrapper< uint16x4_t, 19 > Packet4bf
Definition: PacketMath.h:3317
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f pexp< Packet2f >(const Packet2f &x)
Definition: MathFunctions.h:15
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog(const Packet &a)
Definition: GenericPacketMath.h:796
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet pexp_double(const Packet _x)
Definition: GenericPacketMathFunctions.h:490
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp(const Packet &a)
Definition: GenericPacketMath.h:788
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcos(const Packet &a)
Definition: GenericPacketMath.h:756
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet psin_float(const Packet &x)
Definition: GenericPacketMathFunctions.h:747
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin(const Packet &a)
Definition: GenericPacketMath.h:752
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet pcos_float(const Packet &x)
Definition: GenericPacketMathFunctions.h:755
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f ptanh< Packet4f >(const Packet4f &x)
Definition: MathFunctions.h:82
EIGEN_STRONG_INLINE Packet4f pfrexp< Packet4f >(const Packet4f &a, Packet4f &exponent)
Definition: PacketMath.h:1361
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptanh(const Packet &a)
Definition: GenericPacketMath.h:784
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f plog< Packet2f >(const Packet2f &x)
Definition: MathFunctions.h:20
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet plog_float(const Packet _x)
Definition: GenericPacketMathFunctions.h:254
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f pcos< Packet2f >(const Packet2f &x)
Definition: MathFunctions.h:30
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet plog_double(const Packet _x)
Definition: GenericPacketMathFunctions.h:375
float32x2_t Packet2f
Definition: PacketMath.h:62
EIGEN_STRONG_INLINE Packet4f pldexp< Packet4f >(const Packet4f &a, const Packet4f &exponent)
Definition: PacketMath.h:1354
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2d plog< Packet2d >(const Packet2d &_x)
Definition: MathFunctions.h:28
T generic_fast_tanh_float(const T &a_x)
Definition: MathFunctionsImpl.h:29
EIGEN_STRONG_INLINE Packet8h pldexp(const Packet8h &a, const Packet8h &exponent)
Definition: MathFunctions.h:196
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f pcos< Packet4f >(const Packet4f &_x)
Definition: MathFunctions.h:38
EIGEN_STRONG_INLINE Packet8h pfrexp(const Packet8h &a, Packet8h &exponent)
Definition: MathFunctions.h:188
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f plog< Packet4f >(const Packet4f &_x)
Definition: MathFunctions.h:20
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet pexp_float(const Packet _x)
Definition: GenericPacketMathFunctions.h:439
__vector float Packet4f
Definition: PacketMath.h:30
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f pexp< Packet4f >(const Packet4f &_x)
Definition: MathFunctions.h:26
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2d pexp< Packet2d >(const Packet2d &_x)
Definition: MathFunctions.h:326
EIGEN_STRONG_INLINE Packet8bf F32ToBf16(Packet4f p4f)
Definition: PacketMath.h:1252
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f psin< Packet4f >(const Packet4f &_x)
Definition: MathFunctions.h:32
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f psin< Packet2f >(const Packet2f &x)
Definition: MathFunctions.h:25
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
Definition: document.h:416
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1181
Definition: GenericPacketMath.h:160