22#ifndef UNSUPPORTED_EIGEN_CXX11_SRC_TENSOR_TENSORSYCL_CONVERT_TO_DEVICE_EXPRESSION_HPP
23#define UNSUPPORTED_EIGEN_CXX11_SRC_TENSOR_TENSORSYCL_CONVERT_TO_DEVICE_EXPRESSION_HPP
34template <
typename Expr>
35struct ConvertToDeviceExpression;
37template<
template<
class...>
class NonOpCategory,
bool IsConst,
typename... Args>
38struct NonOpConversion{
39 typedef typename GetType<IsConst, NonOpCategory<typename ConvertToDeviceExpression<Args>::Type...> >::Type Type;
43template<
template<
class,
template <
class>
class >
class NonOpCategory, bool IsConst, typename Args>
44struct DeviceConvertor{
45 typedef typename GetType<IsConst, NonOpCategory<typename ConvertToDeviceExpression<Args>::Type, MakeGlobalPointer> >::Type Type;
50#define TENSORMAPCONVERT(CVQual)\
51template <typename Scalar_, int Options_, int Options2_, int NumIndices_, typename IndexType_, template <class> class MakePointer_>\
52struct ConvertToDeviceExpression<CVQual TensorMap<Tensor<Scalar_, NumIndices_, Options_, IndexType_>, Options2_, MakePointer_> > {\
53 typedef CVQual TensorMap<Tensor<Scalar_, NumIndices_, Options_, IndexType_>, Options2_, MakeGlobalPointer> Type;\
56TENSORMAPCONVERT(
const)
58#undef TENSORMAPCONVERT
62#define CATEGORYCONVERT(CVQual)\
63template <template<class, class...> class Category, typename OP, typename... subExprs>\
64struct ConvertToDeviceExpression<CVQual Category<OP, subExprs...> > {\
65 typedef CVQual Category<OP, typename ConvertToDeviceExpression<subExprs>::Type... > Type;\
74#define SELECTOPCONVERT(CVQual, Res)\
75template <typename IfExpr, typename ThenExpr, typename ElseExpr>\
76struct ConvertToDeviceExpression<CVQual TensorSelectOp<IfExpr, ThenExpr, ElseExpr> >\
77: NonOpConversion<TensorSelectOp, Res, IfExpr, ThenExpr, ElseExpr> {};
78SELECTOPCONVERT(
const,
true)
79SELECTOPCONVERT(, false)
84#define ASSIGNCONVERT(CVQual, Res)\
85template <typename LHSExpr, typename RHSExpr>\
86struct ConvertToDeviceExpression<CVQual TensorAssignOp<LHSExpr, RHSExpr> >\
87: NonOpConversion<TensorAssignOp, Res, LHSExpr, RHSExpr>{};
89ASSIGNCONVERT(
const,
true)
95#define KERNELBROKERCONVERT(CVQual, Res, ExprNode)\
96template <typename Expr>\
97struct ConvertToDeviceExpression<CVQual ExprNode<Expr> > \
98: DeviceConvertor<ExprNode, Res, Expr>{};
100KERNELBROKERCONVERT(
const,
true, TensorForcedEvalOp)
101KERNELBROKERCONVERT(,
false, TensorForcedEvalOp)
102KERNELBROKERCONVERT(
const,
true, TensorEvalToOp)
103KERNELBROKERCONVERT(,
false, TensorEvalToOp)
104#undef KERNELBROKERCONVERT
107#define KERNELBROKERCONVERTREDUCTION(CVQual)\
108template <typename OP, typename Dim, typename subExpr, template <class> class MakePointer_>\
109struct ConvertToDeviceExpression<CVQual TensorReductionOp<OP, Dim, subExpr, MakePointer_> > {\
110 typedef CVQual TensorReductionOp<OP, Dim, typename ConvertToDeviceExpression<subExpr>::Type, MakeGlobalPointer> Type;\
113KERNELBROKERCONVERTREDUCTION(
const)
114KERNELBROKERCONVERTREDUCTION()
115#undef KERNELBROKERCONVERTREDUCTION
Namespace containing all symbols from the Eigen library.
Definition: AdolcForward:45