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)); \ 178 #endif // EIGEN_ASSIGN_VML_H
Jet< T, N > cos(const Jet< T, N > &f)
#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP, VMLMODE)
const unsigned int DirectAccessBit
Jet< T, N > acos(const Jet< T, N > &f)
EIGEN_DEVICE_FUNC const TanhReturnType tanh() const
Jet< T, N > sin(const Jet< T, N > &f)
Namespace containing all symbols from the Eigen library.
const unsigned int RowMajorBit
EIGEN_DEVICE_FUNC const SinhReturnType sinh() const
EIGEN_DEVICE_FUNC const LogReturnType log() const
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS(EIGENOP, VMLOP, VMLMODE)
EIGEN_DEVICE_FUNC const SquareReturnType square() const
std::complex< float > scomplex
std::complex< double > dcomplex
#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(EIGENOP, VMLOP, VMLMODE)
constexpr descr< N - 1 > _(char const (&text)[N])
EIGEN_DEVICE_FUNC const Log10ReturnType log10() const
EIGEN_DEVICE_FUNC const TanReturnType tan() const
Jet< T, N > sqrt(const Jet< T, N > &f)
Jet< T, N > pow(const Jet< T, N > &f, double g)
EIGEN_DEVICE_FUNC const CoshReturnType cosh() const
EIGEN_DEVICE_FUNC const AsinReturnType asin() const
#define EIGEN_MKL_VML_DECLARE_POW_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE)
const unsigned int LinearAccessBit
EIGEN_DEVICE_FUNC const CeilReturnType ceil() const
EIGEN_DEVICE_FUNC const RoundReturnType round() const