TensorSyclConvertToDeviceExpression.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Mehdi Goli Codeplay Software Ltd.
5 // Ralph Potter Codeplay Software Ltd.
6 // Luke Iwanski Codeplay Software Ltd.
7 // Contact: <eigen@codeplay.com>
8 //
9 // This Source Code Form is subject to the terms of the Mozilla
10 // Public License v. 2.0. If a copy of the MPL was not distributed
11 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 
13 /*****************************************************************
14  * TensorSyclConvertToDeviceExpression.h
15  *
16  * \brief:
17  * Conversion from host pointer to device pointer
18  * inside leaf nodes of the expression.
19  *
20 *****************************************************************/
21 
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
24 
25 namespace Eigen {
26 namespace TensorSycl {
27 namespace internal {
28 
34 template <typename Expr>
36 
37 template<template<class...> class NonOpCategory, bool IsConst, typename... Args>
40 };
41 
42 
43 template<template<class, template <class> class > class NonOpCategory, bool IsConst, typename Args>
46 };
47 
50 #define TENSORMAPCONVERT(CVQual)\
51 template <typename Scalar_, int Options_, int Options2_, int NumIndices_, typename IndexType_, template <class> class MakePointer_>\
52 struct ConvertToDeviceExpression<CVQual TensorMap<Tensor<Scalar_, NumIndices_, Options_, IndexType_>, Options2_, MakePointer_> > {\
53  typedef CVQual TensorMap<Tensor<Scalar_, NumIndices_, Options_, IndexType_>, Options2_, MakeGlobalPointer> Type;\
54 };
55 
56 TENSORMAPCONVERT(const)
58 #undef TENSORMAPCONVERT
59 
62 #define CATEGORYCONVERT(CVQual)\
63 template <template<class, class...> class Category, typename OP, typename... subExprs>\
64 struct ConvertToDeviceExpression<CVQual Category<OP, subExprs...> > {\
65  typedef CVQual Category<OP, typename ConvertToDeviceExpression<subExprs>::Type... > Type;\
66 };
67 CATEGORYCONVERT(const)
69 #undef CATEGORYCONVERT
70 
71 
74 #define SELECTOPCONVERT(CVQual, Res)\
75 template <typename IfExpr, typename ThenExpr, typename ElseExpr>\
76 struct ConvertToDeviceExpression<CVQual TensorSelectOp<IfExpr, ThenExpr, ElseExpr> >\
77 : NonOpConversion<TensorSelectOp, Res, IfExpr, ThenExpr, ElseExpr> {};
78 SELECTOPCONVERT(const, true)
79 SELECTOPCONVERT(, false)
80 #undef SELECTOPCONVERT
81 
84 #define ASSIGNCONVERT(CVQual, Res)\
85 template <typename LHSExpr, typename RHSExpr>\
86 struct ConvertToDeviceExpression<CVQual TensorAssignOp<LHSExpr, RHSExpr> >\
87 : NonOpConversion<TensorAssignOp, Res, LHSExpr, RHSExpr>{};
88 
89 ASSIGNCONVERT(const, true)
90 ASSIGNCONVERT(, false)
91 #undef ASSIGNCONVERT
92 
95 #define KERNELBROKERCONVERT(CVQual, Res, ExprNode)\
96 template <typename Expr>\
97 struct ConvertToDeviceExpression<CVQual ExprNode<Expr> > \
98 : DeviceConvertor<ExprNode, Res, Expr>{};
99 
100 KERNELBROKERCONVERT(const, true, TensorForcedEvalOp)
101 KERNELBROKERCONVERT(, false, TensorForcedEvalOp)
102 KERNELBROKERCONVERT(const, true, TensorEvalToOp)
103 KERNELBROKERCONVERT(, false, TensorEvalToOp)
104 #undef KERNELBROKERCONVERT
105 
107 #define KERNELBROKERCONVERTREDUCTION(CVQual)\
108 template <typename OP, typename Dim, typename subExpr, template <class> class MakePointer_>\
109 struct ConvertToDeviceExpression<CVQual TensorReductionOp<OP, Dim, subExpr, MakePointer_> > {\
110  typedef CVQual TensorReductionOp<OP, Dim, typename ConvertToDeviceExpression<subExpr>::Type, MakeGlobalPointer> Type;\
111 };
112 
115 #undef KERNELBROKERCONVERTREDUCTION
116 
117 } // namespace internal
118 } // namespace TensorSycl
119 } // namespace Eigen
120 
121 #endif // UNSUPPORTED_EIGEN_CXX1
#define TENSORMAPCONVERT(CVQual)
#define ASSIGNCONVERT(CVQual, Res)
#define SELECTOPCONVERT(CVQual, Res)
#define KERNELBROKERCONVERTREDUCTION(CVQual)
specialisation of the ConvertToDeviceExpression struct when the node type is TensorReductionOp ...
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
GetType< IsConst, NonOpCategory< typename ConvertToDeviceExpression< Args >::Type, MakeGlobalPointer > >::Type Type
GetType< IsConst, NonOpCategory< typename ConvertToDeviceExpression< Args >::Type... > >::Type Type
#define KERNELBROKERCONVERT(CVQual, Res, ExprNode)
#define CATEGORYCONVERT(CVQual)
This struct is used to convert the MakePointer in the host expression to the MakeGlobalPointer for th...


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:46:01