10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_EXPR_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_EXPR_H
33 template<
typename NullaryOp,
typename XprType>
34 struct traits<TensorCwiseNullaryOp<NullaryOp, XprType> >
38 typedef typename XprType::Scalar Scalar;
39 typedef typename XprType::Nested XprTypeNested;
40 typedef std::remove_reference_t<XprTypeNested> XprTypeNested_;
41 static constexpr
int NumDimensions = XprTraits::NumDimensions;
42 static constexpr
int Layout = XprTraits::Layout;
43 typedef typename XprTraits::PointerType PointerType;
53 template<
typename NullaryOp,
typename XprType>
57 typedef typename Eigen::internal::traits<TensorCwiseNullaryOp>::Scalar
Scalar;
61 typedef typename Eigen::internal::traits<TensorCwiseNullaryOp>::StorageKind
StorageKind;
62 typedef typename Eigen::internal::traits<TensorCwiseNullaryOp>::Index
Index;
82 template<
typename UnaryOp,
typename XprType>
88 typedef typename result_of<UnaryOp(
typename XprType::Scalar)>::type Scalar;
90 typedef typename XprType::Nested XprTypeNested;
91 typedef std::remove_reference_t<XprTypeNested> XprTypeNested_;
92 static constexpr
int NumDimensions = XprTraits::NumDimensions;
93 static constexpr
int Layout = XprTraits::Layout;
94 typedef typename TypeConversion<Scalar,
95 typename XprTraits::PointerType
100 template<
typename UnaryOp,
typename XprType>
101 struct eval<TensorCwiseUnaryOp<UnaryOp, XprType>,
Eigen::Dense>
103 typedef const TensorCwiseUnaryOp<UnaryOp, XprType>& type;
106 template<
typename UnaryOp,
typename XprType>
107 struct nested<TensorCwiseUnaryOp<UnaryOp, XprType>, 1, typename eval<TensorCwiseUnaryOp<UnaryOp, XprType> >::type>
109 typedef TensorCwiseUnaryOp<UnaryOp, XprType> type;
116 template<
typename UnaryOp,
typename XprType>
122 typedef typename Eigen::internal::traits<TensorCwiseUnaryOp>::Scalar
Scalar;
125 typedef typename Eigen::internal::nested<TensorCwiseUnaryOp>::type
Nested;
126 typedef typename Eigen::internal::traits<TensorCwiseUnaryOp>::StorageKind
StorageKind;
127 typedef typename Eigen::internal::traits<TensorCwiseUnaryOp>::Index
Index;
147 template<
typename BinaryOp,
typename LhsXprType,
typename RhsXprType>
154 typedef typename result_of<
155 BinaryOp(
typename LhsXprType::Scalar,
156 typename RhsXprType::Scalar)>::type Scalar;
158 typedef typename promote_storage_type<
161 typedef typename promote_index_type<
164 typedef typename LhsXprType::Nested LhsNested;
165 typedef typename RhsXprType::Nested RhsNested;
166 typedef std::remove_reference_t<LhsNested> LhsNested_;
167 typedef std::remove_reference_t<RhsNested> RhsNested_;
168 static constexpr
int NumDimensions = XprTraits::NumDimensions;
169 static constexpr
int Layout = XprTraits::Layout;
170 typedef typename TypeConversion<Scalar,
171 std::conditional_t<Pointer_type_promotion<typename LhsXprType::Scalar, Scalar>::val,
181 template<
typename BinaryOp,
typename LhsXprType,
typename RhsXprType>
182 struct eval<TensorCwiseBinaryOp<
BinaryOp, LhsXprType, RhsXprType>,
Eigen::Dense>
184 typedef const TensorCwiseBinaryOp<BinaryOp, LhsXprType, RhsXprType>& type;
187 template<
typename BinaryOp,
typename LhsXprType,
typename RhsXprType>
188 struct nested<TensorCwiseBinaryOp<
BinaryOp, LhsXprType, RhsXprType>, 1, typename eval<TensorCwiseBinaryOp<
BinaryOp, LhsXprType, RhsXprType> >::type>
190 typedef TensorCwiseBinaryOp<BinaryOp, LhsXprType, RhsXprType> type;
197 template<
typename BinaryOp,
typename LhsXprType,
typename RhsXprType>
203 typedef typename Eigen::internal::traits<TensorCwiseBinaryOp>::Scalar
Scalar;
206 typedef typename Eigen::internal::nested<TensorCwiseBinaryOp>::type
Nested;
207 typedef typename Eigen::internal::traits<TensorCwiseBinaryOp>::StorageKind
StorageKind;
208 typedef typename Eigen::internal::traits<TensorCwiseBinaryOp>::Index
Index;
233 template<
typename TernaryOp,
typename Arg1XprType,
typename Arg2XprType,
typename Arg3XprType>
237 typedef typename result_of<
238 TernaryOp(
typename Arg1XprType::Scalar,
239 typename Arg2XprType::Scalar,
240 typename Arg3XprType::Scalar)>::type Scalar;
244 typedef typename Arg1XprType::Nested Arg1Nested;
245 typedef typename Arg2XprType::Nested Arg2Nested;
246 typedef typename Arg3XprType::Nested Arg3Nested;
247 typedef std::remove_reference_t<Arg1Nested> Arg1Nested_;
248 typedef std::remove_reference_t<Arg2Nested> Arg2Nested_;
249 typedef std::remove_reference_t<Arg3Nested> Arg3Nested_;
250 static constexpr
int NumDimensions = XprTraits::NumDimensions;
251 static constexpr
int Layout = XprTraits::Layout;
252 typedef typename TypeConversion<Scalar,
253 std::conditional_t<Pointer_type_promotion<typename Arg2XprType::Scalar, Scalar>::val,
263 template<
typename TernaryOp,
typename Arg1XprType,
typename Arg2XprType,
typename Arg3XprType>
264 struct eval<TensorCwiseTernaryOp<TernaryOp, Arg1XprType, Arg2XprType, Arg3XprType>,
Eigen::Dense>
266 typedef const TensorCwiseTernaryOp<TernaryOp, Arg1XprType, Arg2XprType, Arg3XprType>& type;
269 template<
typename TernaryOp,
typename Arg1XprType,
typename Arg2XprType,
typename Arg3XprType>
270 struct nested<TensorCwiseTernaryOp<TernaryOp, Arg1XprType, Arg2XprType, Arg3XprType>, 1, typename eval<TensorCwiseTernaryOp<TernaryOp, Arg1XprType, Arg2XprType, Arg3XprType> >::type>
272 typedef TensorCwiseTernaryOp<TernaryOp, Arg1XprType, Arg2XprType, Arg3XprType> type;
279 template<
typename TernaryOp,
typename Arg1XprType,
typename Arg2XprType,
typename Arg3XprType>
283 typedef typename Eigen::internal::traits<TensorCwiseTernaryOp>::Scalar
Scalar;
286 typedef typename Eigen::internal::nested<TensorCwiseTernaryOp>::type
Nested;
287 typedef typename Eigen::internal::traits<TensorCwiseTernaryOp>::StorageKind
StorageKind;
288 typedef typename Eigen::internal::traits<TensorCwiseTernaryOp>::Index
Index;
318 template<
typename IfXprType,
typename ThenXprType,
typename ElseXprType>
324 typedef typename promote_storage_type<typename traits<ThenXprType>::StorageKind,
326 typedef typename promote_index_type<typename traits<ElseXprType>::Index,
328 typedef typename IfXprType::Nested IfNested;
329 typedef typename ThenXprType::Nested ThenNested;
330 typedef typename ElseXprType::Nested ElseNested;
331 static constexpr
int NumDimensions = XprTraits::NumDimensions;
332 static constexpr
int Layout = XprTraits::Layout;
333 typedef std::conditional_t<Pointer_type_promotion<typename ThenXprType::Scalar, Scalar>::val,
338 template<
typename IfXprType,
typename ThenXprType,
typename ElseXprType>
339 struct eval<TensorSelectOp<IfXprType, ThenXprType, ElseXprType>,
Eigen::Dense>
341 typedef const TensorSelectOp<IfXprType, ThenXprType, ElseXprType>& type;
344 template<
typename IfXprType,
typename ThenXprType,
typename ElseXprType>
345 struct nested<TensorSelectOp<IfXprType, ThenXprType, ElseXprType>, 1, typename eval<TensorSelectOp<IfXprType, ThenXprType, ElseXprType> >::type>
347 typedef TensorSelectOp<IfXprType, ThenXprType, ElseXprType> type;
353 template<
typename IfXprType,
typename ThenXprType,
typename ElseXprType>
357 typedef typename Eigen::internal::traits<TensorSelectOp>::Scalar
Scalar;
359 typedef typename internal::promote_storage_type<
typename ThenXprType::CoeffReturnType,
361 typedef typename Eigen::internal::nested<TensorSelectOp>::type
Nested;
362 typedef typename Eigen::internal::traits<TensorSelectOp>::StorageKind
StorageKind;
363 typedef typename Eigen::internal::traits<TensorSelectOp>::Index
Index;
367 const ThenXprType& a_then,
368 const ElseXprType& a_else)
#define EIGEN_DEVICE_FUNC
Eigen::internal::traits< TensorCwiseBinaryOp >::Index Index
RhsXprType::Nested m_rhs_xpr
const internal::remove_all_t< typename LhsXprType::Nested > & lhsExpression() const
Eigen::internal::nested< TensorCwiseBinaryOp >::type Nested
const internal::remove_all_t< typename RhsXprType::Nested > & rhsExpression() const
Eigen::internal::traits< TensorCwiseBinaryOp >::Scalar Scalar
const BinaryOp & functor() const
Eigen::internal::traits< TensorCwiseBinaryOp >::StorageKind StorageKind
LhsXprType::Nested m_lhs_xpr
TensorCwiseBinaryOp(const LhsXprType &lhs, const RhsXprType &rhs, const BinaryOp &func=BinaryOp())
Eigen::NumTraits< Scalar >::Real RealScalar
const NullaryOp & functor() const
const internal::remove_all_t< typename XprType::Nested > & nestedExpression() const
TensorCwiseNullaryOp< NullaryOp, XprType > Nested
Eigen::internal::traits< TensorCwiseNullaryOp >::Scalar Scalar
Eigen::NumTraits< Scalar >::Real RealScalar
Eigen::internal::traits< TensorCwiseNullaryOp >::StorageKind StorageKind
XprType::CoeffReturnType CoeffReturnType
TensorCwiseNullaryOp(const XprType &xpr, const NullaryOp &func=NullaryOp())
const NullaryOp m_functor
Eigen::internal::traits< TensorCwiseNullaryOp >::Index Index
Eigen::internal::traits< TensorCwiseTernaryOp >::StorageKind StorageKind
Arg3XprType::Nested m_arg3_xpr
const internal::remove_all_t< typename Arg3XprType::Nested > & arg3Expression() const
TensorCwiseTernaryOp(const Arg1XprType &arg1, const Arg2XprType &arg2, const Arg3XprType &arg3, const TernaryOp &func=TernaryOp())
const TernaryOp & functor() const
Eigen::NumTraits< Scalar >::Real RealScalar
const internal::remove_all_t< typename Arg2XprType::Nested > & arg2Expression() const
const internal::remove_all_t< typename Arg1XprType::Nested > & arg1Expression() const
Arg2XprType::Nested m_arg2_xpr
Eigen::internal::traits< TensorCwiseTernaryOp >::Index Index
Eigen::internal::traits< TensorCwiseTernaryOp >::Scalar Scalar
const TernaryOp m_functor
Arg1XprType::Nested m_arg1_xpr
Eigen::internal::nested< TensorCwiseTernaryOp >::type Nested
Eigen::internal::traits< TensorCwiseUnaryOp >::StorageKind StorageKind
TensorCwiseUnaryOp(const XprType &xpr, const UnaryOp &func=UnaryOp())
Eigen::internal::traits< TensorCwiseUnaryOp >::Scalar Scalar
const internal::remove_all_t< typename XprType::Nested > & nestedExpression() const
Eigen::internal::traits< TensorCwiseUnaryOp >::Index Index
Eigen::internal::nested< TensorCwiseUnaryOp >::type Nested
Eigen::NumTraits< Scalar >::Real RealScalar
const UnaryOp & functor() const
const IfXprType & ifExpression() const
ThenXprType::Nested m_then
const ThenXprType & thenExpression() const
Eigen::internal::traits< TensorSelectOp >::Index Index
Eigen::NumTraits< Scalar >::Real RealScalar
const ElseXprType & elseExpression() const
Eigen::internal::nested< TensorSelectOp >::type Nested
Eigen::internal::traits< TensorSelectOp >::StorageKind StorageKind
TensorSelectOp(const IfXprType &a_condition, const ThenXprType &a_then, const ElseXprType &a_else)
Eigen::internal::traits< TensorSelectOp >::Scalar Scalar
IfXprType::Nested m_condition
ElseXprType::Nested m_else
internal::promote_storage_type< typename ThenXprType::CoeffReturnType, typename ElseXprType::CoeffReturnType >::ret CoeffReturnType
typename remove_all< T >::type remove_all_t
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index