22#ifndef UNSUPPORTED_EIGEN_CXX11_SRC_TENSOR_TENSORSYCL_PLACEHOLDER_EXPR_HPP
23#define UNSUPPORTED_EIGEN_CXX11_SRC_TENSOR_TENSORSYCL_PLACEHOLDER_EXPR_HPP
33template <
typename Scalar,
size_t N>
35 static constexpr size_t I = N;
43template <
typename Expr,
size_t N>
44struct PlaceHolderExpression;
46template<
size_t N,
typename... Args>
49template<
size_t N,
typename Arg>
50struct CalculateIndex<N, Arg>{
51 typedef typename PlaceHolderExpression<Arg, N>::Type ArgType;
55template<
size_t N,
typename Arg1,
typename Arg2>
56struct CalculateIndex<N, Arg1, Arg2>{
57 static const size_t Arg2LeafCount = LeafCount<Arg2>::Count;
58 typedef typename PlaceHolderExpression<Arg1, N - Arg2LeafCount>::Type Arg1Type;
59 typedef typename PlaceHolderExpression<Arg2, N>::Type Arg2Type;
63template<
size_t N,
typename Arg1,
typename Arg2,
typename Arg3>
64struct CalculateIndex<N, Arg1, Arg2, Arg3> {
65 static const size_t Arg3LeafCount = LeafCount<Arg3>::Count;
66 static const size_t Arg2LeafCount = LeafCount<Arg2>::Count;
67 typedef typename PlaceHolderExpression<Arg1, N - Arg3LeafCount - Arg2LeafCount>::Type Arg1Type;
68 typedef typename PlaceHolderExpression<Arg2, N - Arg3LeafCount>::Type Arg2Type;
69 typedef typename PlaceHolderExpression<Arg3, N>::Type Arg3Type;
73template<
template<
class...>
class Category ,
class OP,
class TPL>
76template<
template<
class...>
class Category ,
class OP,
class ...T >
77struct CategoryHelper<Category, OP, utility::tuple::Tuple<T...> > {
78 typedef Category<OP, T... > Type;
81template<
template<
class...>
class Category ,
class ...T >
82struct CategoryHelper<Category, NoOP, utility::tuple::Tuple<T...> > {
83 typedef Category<T... > Type;
88#define OPEXPRCATEGORY(CVQual)\
89template <template <class, class... > class Category, typename OP, typename... SubExpr, size_t N>\
90struct PlaceHolderExpression<CVQual Category<OP, SubExpr...>, N>{\
91 typedef CVQual typename CategoryHelper<Category, OP, typename CalculateIndex<N, SubExpr...>::ArgsTuple>::Type Type;\
100#define SELECTEXPR(CVQual)\
101template <typename IfExpr, typename ThenExpr, typename ElseExpr, size_t N>\
102struct PlaceHolderExpression<CVQual TensorSelectOp<IfExpr, ThenExpr, ElseExpr>, N> {\
103 typedef CVQual typename CategoryHelper<TensorSelectOp, NoOP, typename CalculateIndex<N, IfExpr, ThenExpr, ElseExpr>::ArgsTuple>::Type Type;\
112#define ASSIGNEXPR(CVQual)\
113template <typename LHSExpr, typename RHSExpr, size_t N>\
114struct PlaceHolderExpression<CVQual TensorAssignOp<LHSExpr, RHSExpr>, N> {\
115 typedef CVQual typename CategoryHelper<TensorAssignOp, NoOP, typename CalculateIndex<N, LHSExpr, RHSExpr>::ArgsTuple>::Type Type;\
124#define TENSORMAPEXPR(CVQual)\
125template <typename Scalar_, int Options_, int Options2_, int NumIndices_, typename IndexType_, template <class> class MakePointer_, size_t N>\
126struct PlaceHolderExpression< CVQual TensorMap< Tensor<Scalar_, NumIndices_, Options_, IndexType_>, Options2_, MakePointer_>, N> {\
127 typedef CVQual PlaceHolder<CVQual TensorMap<Tensor<Scalar_, NumIndices_, Options_, IndexType_>, Options2_, MakePointer_>, N> Type;\
136#define FORCEDEVAL(CVQual)\
137template <typename Expr, size_t N>\
138struct PlaceHolderExpression<CVQual TensorForcedEvalOp<Expr>, N> {\
139 typedef CVQual PlaceHolder<CVQual TensorForcedEvalOp<Expr>, N> Type;\
148#define EVALTO(CVQual)\
149template <typename Expr, size_t N>\
150struct PlaceHolderExpression<CVQual TensorEvalToOp<Expr>, N> {\
151 typedef CVQual TensorEvalToOp<typename CalculateIndex <N, Expr>::ArgType> Type;\
161#define SYCLREDUCTION(CVQual)\
162template <typename OP, typename Dims, typename Expr, size_t N>\
163struct PlaceHolderExpression<CVQual TensorReductionOp<OP, Dims, Expr>, N>{\
164 typedef CVQual PlaceHolder<CVQual TensorReductionOp<OP, Dims,Expr>, N> Type;\
171template <
typename Expr>
172struct createPlaceHolderExpression {
173 static const size_t TotalLeaves = LeafCount<Expr>::Count;
174 typedef typename PlaceHolderExpression<Expr, TotalLeaves - 1>::Type Type;
Namespace containing all symbols from the Eigen library.
Definition: AdolcForward:45
is a fixed-size collection of heterogeneous values \ztparam Ts... - the types of the elements that th...
Definition: TensorSyclTuple.h:40