arch/AltiVec/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 // Copyright (C) 2007 Julien Pommier
5 // Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr>
6 // Copyright (C) 2016 Konstantinos Margaritis <markos@freevec.org>
7 //
8 // This Source Code Form is subject to the terms of the Mozilla
9 // Public License v. 2.0. If a copy of the MPL was not distributed
10 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 
12 #ifndef EIGEN_MATH_FUNCTIONS_ALTIVEC_H
13 #define EIGEN_MATH_FUNCTIONS_ALTIVEC_H
14 
15 // IWYU pragma: private
16 #include "../../InternalHeaderCheck.h"
17 
18 namespace Eigen {
19 
20 namespace internal {
21 
23 #ifdef EIGEN_VECTORIZE_VSX
25 #endif
26 
27 #ifdef EIGEN_VECTORIZE_VSX
28 template <>
30  return vec_sqrt(x);
31 }
32 
33 template <>
35  return vec_sqrt(x);
36 }
37 
38 #if !EIGEN_COMP_CLANG
39 template <>
41  return pset1<Packet4f>(1.0f) / psqrt<Packet4f>(x);
42  // vec_rsqrt returns different results from the generic version
43  // return vec_rsqrt(x);
44 }
45 
46 template <>
48  return pset1<Packet2d>(1.0) / psqrt<Packet2d>(x);
49  // vec_rsqrt returns different results from the generic version
50  // return vec_rsqrt(x);
51 }
52 
53 #endif
54 
55 template <>
56 EIGEN_STRONG_INLINE Packet8bf psqrt<Packet8bf>(const Packet8bf& a) {
58 }
59 
60 #if !EIGEN_COMP_CLANG
61 template <>
62 EIGEN_STRONG_INLINE Packet8bf prsqrt<Packet8bf>(const Packet8bf& a) {
64 }
65 #endif
66 #else
67 template <>
69  Packet4f a;
70  for (Index i = 0; i < packet_traits<float>::size; i++) {
71  a[i] = numext::sqrt(x[i]);
72  }
73  return a;
74 }
75 #endif
76 
77 } // end namespace internal
78 
79 } // end namespace Eigen
80 
81 #endif // EIGEN_MATH_FUNCTIONS_ALTIVEC_H
#define BF16_TO_F32_UNARY_OP_WRAPPER(OP, A)
Definition: AltiVec/PacketMath.h:2257
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_INSTANTIATE_GENERIC_MATH_FUNCS_DOUBLE(PACKET)
Definition: GenericPacketMathFunctionsFwd.h:203
#define EIGEN_INSTANTIATE_GENERIC_MATH_FUNCS_FLOAT(PACKET)
Definition: GenericPacketMathFunctionsFwd.h:188
#define EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
Definition: Macros.h:900
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
const Scalar * a
Definition: level2_cplx_impl.h:32
__m128d Packet2d
Definition: LSX/PacketMath.h:36
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet4f psqrt< Packet4f >(const Packet4f &x)
Definition: arch/AltiVec/MathFunctions.h:68
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet2d prsqrt< Packet2d >(const Packet2d &x)
Definition: arch/ZVector/MathFunctions.h:204
EIGEN_STRONG_INLINE Packet2d pset1< Packet2d >(const double &from)
Definition: LSX/PacketMath.h:503
eigen_packet_wrapper< __vector unsigned short int, 0 > Packet8bf
Definition: AltiVec/PacketMath.h:42
EIGEN_STRONG_INLINE Packet4f pset1< Packet4f >(const float &from)
Definition: AltiVec/PacketMath.h:773
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet2d psqrt< Packet2d >(const Packet2d &x)
Definition: arch/SSE/MathFunctions.h:37
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet4f prsqrt< Packet4f >(const Packet4f &x)
Definition: arch/ZVector/MathFunctions.h:209
__vector float Packet4f
Definition: AltiVec/PacketMath.h:33
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float sqrt(const float &x)
Definition: arch/SSE/MathFunctions.h:69
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
Definition: Eigen_Colamd.h:49
list x
Definition: plotDoE.py:28