34 #ifndef EIGEN_ASSIGN_VML_H
35 #define EIGEN_ASSIGN_VML_H
41 template<
typename Dst,
typename Src>
49 InnerSize =
int(Dst::IsVectorAtCompileTime) ? int(Dst::SizeAtCompileTime)
51 : int(Dst::RowsAtCompileTime),
54 : int(Dst::MaxRowsAtCompileTime),
69 #define EIGEN_PP_EXPAND(ARG) ARG
70 #if !defined (EIGEN_FAST_MATH) || (EIGEN_FAST_MATH != 1)
71 #define EIGEN_VMLMODE_EXPAND_xLA , VML_HA
73 #define EIGEN_VMLMODE_EXPAND_xLA , VML_LA
76 #define EIGEN_VMLMODE_EXPAND_x_
78 #define EIGEN_VMLMODE_PREFIX_xLA vm
79 #define EIGEN_VMLMODE_PREFIX_x_ v
80 #define EIGEN_VMLMODE_PREFIX(VMLMODE) EIGEN_CAT(EIGEN_VMLMODE_PREFIX_x,VMLMODE)
82 #define EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE) \
83 template< typename DstXprType, typename SrcXprNested> \
84 struct Assignment<DstXprType, CwiseUnaryOp<scalar_##EIGENOP##_op<EIGENTYPE>, SrcXprNested>, assign_op<EIGENTYPE,EIGENTYPE>, \
85 Dense2Dense, typename enable_if<vml_assign_traits<DstXprType,SrcXprNested>::EnableVml>::type> { \
86 typedef CwiseUnaryOp<scalar_##EIGENOP##_op<EIGENTYPE>, SrcXprNested> SrcXprType; \
87 static void run(DstXprType &dst, const SrcXprType &src, const assign_op<EIGENTYPE,EIGENTYPE> &func) { \
88 resize_if_allowed(dst, src, func); \
89 eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); \
90 if(vml_assign_traits<DstXprType,SrcXprNested>::Traversal==LinearTraversal) { \
91 VMLOP(dst.size(), (const VMLTYPE*)src.nestedExpression().data(), \
92 (VMLTYPE*)dst.data() EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_x##VMLMODE) ); \
94 const Index outerSize = dst.outerSize(); \
95 for(Index outer = 0; outer < outerSize; ++outer) { \
96 const EIGENTYPE *src_ptr = src.IsRowMajor ? &(src.nestedExpression().coeffRef(outer,0)) : \
97 &(src.nestedExpression().coeffRef(0, outer)); \
98 EIGENTYPE *dst_ptr = dst.IsRowMajor ? &(dst.coeffRef(outer,0)) : &(dst.coeffRef(0, outer)); \
99 VMLOP( dst.innerSize(), (const VMLTYPE*)src_ptr, \
100 (VMLTYPE*)dst_ptr EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_x##VMLMODE)); \
107 #define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP, VMLMODE) \
108 EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),s##VMLOP), float, float, VMLMODE) \
109 EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),d##VMLOP), double, double, VMLMODE)
111 #define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(EIGENOP, VMLOP, VMLMODE) \
112 EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),c##VMLOP), scomplex, MKL_Complex8, VMLMODE) \
113 EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),z##VMLOP), dcomplex, MKL_Complex16, VMLMODE)
115 #define EIGEN_MKL_VML_DECLARE_UNARY_CALLS(EIGENOP, VMLOP, VMLMODE) \
116 EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP, VMLMODE) \
117 EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(EIGENOP, VMLOP, VMLMODE)
141 #define EIGEN_MKL_VML_DECLARE_POW_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE) \
142 template< typename DstXprType, typename SrcXprNested, typename Plain> \
143 struct Assignment<DstXprType, CwiseBinaryOp<scalar_##EIGENOP##_op<EIGENTYPE,EIGENTYPE>, SrcXprNested, \
144 const CwiseNullaryOp<internal::scalar_constant_op<EIGENTYPE>,Plain> >, assign_op<EIGENTYPE,EIGENTYPE>, \
145 Dense2Dense, typename enable_if<vml_assign_traits<DstXprType,SrcXprNested>::EnableVml>::type> { \
146 typedef CwiseBinaryOp<scalar_##EIGENOP##_op<EIGENTYPE,EIGENTYPE>, SrcXprNested, \
147 const CwiseNullaryOp<internal::scalar_constant_op<EIGENTYPE>,Plain> > SrcXprType; \
148 static void run(DstXprType &dst, const SrcXprType &src, const assign_op<EIGENTYPE,EIGENTYPE> &func) { \
149 resize_if_allowed(dst, src, func); \
150 eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); \
151 VMLTYPE exponent = reinterpret_cast<const VMLTYPE&>(src.rhs().functor().m_other); \
152 if(vml_assign_traits<DstXprType,SrcXprNested>::Traversal==LinearTraversal) \
154 VMLOP( dst.size(), (const VMLTYPE*)src.lhs().data(), exponent, \
155 (VMLTYPE*)dst.data() EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_x##VMLMODE) ); \
157 const Index outerSize = dst.outerSize(); \
158 for(Index outer = 0; outer < outerSize; ++outer) { \
159 const EIGENTYPE *src_ptr = src.IsRowMajor ? &(src.lhs().coeffRef(outer,0)) : \
160 &(src.lhs().coeffRef(0, outer)); \
161 EIGENTYPE *dst_ptr = dst.IsRowMajor ? &(dst.coeffRef(outer,0)) : &(dst.coeffRef(0, outer)); \
162 VMLOP( dst.innerSize(), (const VMLTYPE*)src_ptr, exponent, \
163 (VMLTYPE*)dst_ptr EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_x##VMLMODE)); \
EIGEN_DEVICE_FUNC const TanReturnType tan() const
Definition: ArrayCwiseUnaryOps.h:269
EIGEN_DEVICE_FUNC const Log10ReturnType log10() const
Definition: ArrayCwiseUnaryOps.h:158
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
Definition: ArrayCwiseUnaryOps.h:97
EIGEN_DEVICE_FUNC const SinhReturnType sinh() const
Definition: ArrayCwiseUnaryOps.h:339
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
Definition: ArrayCwiseUnaryOps.h:481
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArgReturnType arg() const
Definition: ArrayCwiseUnaryOps.h:66
EIGEN_DEVICE_FUNC const LogReturnType log() const
Definition: ArrayCwiseUnaryOps.h:128
EIGEN_DEVICE_FUNC const AcosReturnType acos() const
Definition: ArrayCwiseUnaryOps.h:297
EIGEN_DEVICE_FUNC const CeilReturnType ceil() const
Definition: ArrayCwiseUnaryOps.h:495
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Definition: ArrayCwiseUnaryOps.h:187
EIGEN_DEVICE_FUNC const AsinReturnType asin() const
Definition: ArrayCwiseUnaryOps.h:311
EIGEN_DEVICE_FUNC const CosReturnType cos() const
Definition: ArrayCwiseUnaryOps.h:237
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Definition: ArrayCwiseUnaryOps.h:255
EIGEN_DEVICE_FUNC const SquareReturnType square() const
Definition: ArrayCwiseUnaryOps.h:425
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
Definition: ArrayCwiseUnaryOps.h:283
EIGEN_DEVICE_FUNC const RoundReturnType round() const
Definition: ArrayCwiseUnaryOps.h:467
EIGEN_DEVICE_FUNC const TanhReturnType tanh() const
Definition: ArrayCwiseUnaryOps.h:325
EIGEN_DEVICE_FUNC const CoshReturnType cosh() const
Definition: ArrayCwiseUnaryOps.h:353
#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP, VMLMODE)
Definition: Assign_MKL.h:107
#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS(EIGENOP, VMLOP, VMLMODE)
Definition: Assign_MKL.h:115
#define EIGEN_MKL_VML_DECLARE_POW_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE)
Definition: Assign_MKL.h:141
#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(EIGENOP, VMLOP, VMLMODE)
Definition: Assign_MKL.h:111
Definition: Assign_MKL.h:43
@ SrcHasDirectAccess
Definition: Assign_MKL.h:47
@ InnerSize
Definition: Assign_MKL.h:49
@ StorageOrdersAgree
Definition: Assign_MKL.h:48
@ MaxSizeAtCompileTime
Definition: Assign_MKL.h:55
@ InnerMaxSize
Definition: Assign_MKL.h:52
@ MightEnableVml
Definition: Assign_MKL.h:57
@ DstHasDirectAccess
Definition: Assign_MKL.h:46
@ MightLinearize
Definition: Assign_MKL.h:58
@ VmlSize
Definition: Assign_MKL.h:59
@ EnableVml
Definition: Assign_MKL.h:64
@ Traversal
Definition: Assign_MKL.h:65
const unsigned int LinearAccessBit
Definition: Constants.h:130
const unsigned int DirectAccessBit
Definition: Constants.h:155
const unsigned int RowMajorBit
Definition: Constants.h:66
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:514
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
@ DefaultTraversal
Definition: Constants.h:277
@ LinearTraversal
Definition: Constants.h:279
std::complex< double > dcomplex
Definition: MKL_support.h:125
std::complex< float > scomplex
Definition: MKL_support.h:126
const int Dynamic
Definition: Constants.h:22
Flags
Special flags for archives.
Definition: cereal.hpp:185
Definition: document.h:416