TensorCustomOp.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 // Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_CUSTOM_OP_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_CUSTOM_OP_H
12 
13 namespace Eigen {
14 
22 namespace internal {
23 template<typename CustomUnaryFunc, typename XprType>
24 struct traits<TensorCustomUnaryOp<CustomUnaryFunc, XprType> >
25 {
26  typedef typename XprType::Scalar Scalar;
27  typedef typename XprType::StorageKind StorageKind;
28  typedef typename XprType::Index Index;
29  typedef typename XprType::Nested Nested;
31  static const int NumDimensions = traits<XprType>::NumDimensions;
32  static const int Layout = traits<XprType>::Layout;
34 };
35 
36 template<typename CustomUnaryFunc, typename XprType>
37 struct eval<TensorCustomUnaryOp<CustomUnaryFunc, XprType>, Eigen::Dense>
38 {
40 };
41 
42 template<typename CustomUnaryFunc, typename XprType>
43 struct nested<TensorCustomUnaryOp<CustomUnaryFunc, XprType> >
44 {
46 };
47 
48 } // end namespace internal
49 
50 
51 
52 template<typename CustomUnaryFunc, typename XprType>
53 class TensorCustomUnaryOp : public TensorBase<TensorCustomUnaryOp<CustomUnaryFunc, XprType>, ReadOnlyAccessors>
54 {
55  public:
58  typedef typename XprType::CoeffReturnType CoeffReturnType;
62 
64  : m_expr(expr), m_func(func) {}
65 
67  const CustomUnaryFunc& func() const { return m_func; }
68 
71  expression() const { return m_expr; }
72 
73  protected:
74  typename XprType::Nested m_expr;
75  const CustomUnaryFunc m_func;
76 };
77 
78 
79 // Eval as rvalue
80 template<typename CustomUnaryFunc, typename XprType, typename Device>
81 struct TensorEvaluator<const TensorCustomUnaryOp<CustomUnaryFunc, XprType>, Device>
82 {
85  static const int NumDims = internal::traits<ArgType>::NumDimensions;
94 
95  enum {
96  IsAligned = false,
98  BlockAccess = false,
101  CoordAccess = false, // to be implemented
102  RawAccess = false
103  };
104 
105  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
107  //===--------------------------------------------------------------------===//
108 
109  EIGEN_STRONG_INLINE TensorEvaluator(const ArgType& op, const Device& device)
110  : m_op(op), m_device(device), m_result(NULL)
111  {
112  m_dimensions = op.func().dimensions(op.expression());
113  }
114 
115  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_dimensions; }
116 
118  if (data) {
119  evalTo(data);
120  return false;
121  } else {
122  m_result = static_cast<EvaluatorPointerType>(m_device.get( (CoeffReturnType*)
123  m_device.allocate_temp(dimensions().TotalSize() * sizeof(Scalar))));
124  evalTo(m_result);
125  return true;
126  }
127  }
128 
130  if (m_result) {
131  m_device.deallocate_temp(m_result);
132  m_result = NULL;
133  }
134  }
135 
137  return m_result[index];
138  }
139 
140  template<int LoadMode>
142  return internal::ploadt<PacketReturnType, LoadMode>(m_result + index);
143  }
144 
146  // TODO(rmlarsen): Extend CustomOp API to return its cost estimate.
147  return TensorOpCost(sizeof(CoeffReturnType), 0, 0, vectorized, PacketSize);
148  }
149 
150  EIGEN_DEVICE_FUNC EvaluatorPointerType data() const { return m_result; }
151 
152 #ifdef EIGEN_USE_SYCL
153  // binding placeholder accessors to a command group handler for SYCL
154  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void bind(cl::sycl::handler &cgh) const {
155  m_result.bind(cgh);
156  }
157 #endif
158 
159  protected:
162  m_op.func().eval(m_op.expression(), result, m_device);
163  }
164 
166  const ArgType m_op;
169 };
170 
171 
172 
180 namespace internal {
181 template<typename CustomBinaryFunc, typename LhsXprType, typename RhsXprType>
182 struct traits<TensorCustomBinaryOp<CustomBinaryFunc, LhsXprType, RhsXprType> >
183 {
184  typedef typename internal::promote_storage_type<typename LhsXprType::Scalar,
186  typedef typename internal::promote_storage_type<typename LhsXprType::CoeffReturnType,
187  typename RhsXprType::CoeffReturnType>::ret CoeffReturnType;
192  typedef typename LhsXprType::Nested LhsNested;
193  typedef typename RhsXprType::Nested RhsNested;
196  static const int NumDimensions = traits<LhsXprType>::NumDimensions;
197  static const int Layout = traits<LhsXprType>::Layout;
200 };
201 
202 template<typename CustomBinaryFunc, typename LhsXprType, typename RhsXprType>
203 struct eval<TensorCustomBinaryOp<CustomBinaryFunc, LhsXprType, RhsXprType>, Eigen::Dense>
204 {
206 };
207 
208 template<typename CustomBinaryFunc, typename LhsXprType, typename RhsXprType>
209 struct nested<TensorCustomBinaryOp<CustomBinaryFunc, LhsXprType, RhsXprType> >
210 {
212 };
213 
214 } // end namespace internal
215 
216 
217 
218 template<typename CustomBinaryFunc, typename LhsXprType, typename RhsXprType>
219 class TensorCustomBinaryOp : public TensorBase<TensorCustomBinaryOp<CustomBinaryFunc, LhsXprType, RhsXprType>, ReadOnlyAccessors>
220 {
221  public:
228 
229  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorCustomBinaryOp(const LhsXprType& lhs, const RhsXprType& rhs, const CustomBinaryFunc& func)
230 
231  : m_lhs_xpr(lhs), m_rhs_xpr(rhs), m_func(func) {}
232 
234  const CustomBinaryFunc& func() const { return m_func; }
235 
238  lhsExpression() const { return m_lhs_xpr; }
239 
242  rhsExpression() const { return m_rhs_xpr; }
243 
244  protected:
245  typename LhsXprType::Nested m_lhs_xpr;
246  typename RhsXprType::Nested m_rhs_xpr;
247  const CustomBinaryFunc m_func;
248 };
249 
250 
251 // Eval as rvalue
252 template<typename CustomBinaryFunc, typename LhsXprType, typename RhsXprType, typename Device>
253 struct TensorEvaluator<const TensorCustomBinaryOp<CustomBinaryFunc, LhsXprType, RhsXprType>, Device>
254 {
257  static const int NumDims = internal::traits<XprType>::NumDimensions;
259  typedef typename XprType::Scalar Scalar;
263 
267 
268  enum {
269  IsAligned = false,
271  BlockAccess = false,
274  CoordAccess = false, // to be implemented
275  RawAccess = false
276  };
277 
278  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
280  //===--------------------------------------------------------------------===//
281 
282  EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device)
283  : m_op(op), m_device(device), m_result(NULL)
284  {
285  m_dimensions = op.func().dimensions(op.lhsExpression(), op.rhsExpression());
286  }
287 
288  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_dimensions; }
289 
291  if (data) {
292  evalTo(data);
293  return false;
294  } else {
295  m_result = static_cast<EvaluatorPointerType>(m_device.get( (CoeffReturnType*)
296  m_device.allocate_temp(dimensions().TotalSize() * sizeof(CoeffReturnType))));
297  evalTo(m_result);
298  return true;
299  }
300  }
301 
303  if (m_result != NULL) {
304  m_device.deallocate_temp(m_result);
305  m_result = NULL;
306  }
307  }
308 
310  return m_result[index];
311  }
312 
313  template<int LoadMode>
315  return internal::ploadt<PacketReturnType, LoadMode>(m_result + index);
316  }
317 
319  // TODO(rmlarsen): Extend CustomOp API to return its cost estimate.
320  return TensorOpCost(sizeof(CoeffReturnType), 0, 0, vectorized, PacketSize);
321  }
322 
323  EIGEN_DEVICE_FUNC EvaluatorPointerType data() const { return m_result; }
324 
325 #ifdef EIGEN_USE_SYCL
326  // binding placeholder accessors to a command group handler for SYCL
327  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void bind(cl::sycl::handler &cgh) const {
328  m_result.bind(cgh);
329  }
330 #endif
331 
332  protected:
335  m_op.func().eval(m_op.lhsExpression(), m_op.rhsExpression(), result, m_device);
336  }
337 
339  const XprType m_op;
342 };
343 
344 
345 } // end namespace Eigen
346 
347 #endif // EIGEN_CXX11_TENSOR_TENSOR_CUSTOM_OP_H
Eigen::TensorEvaluator::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorEvaluator.h:73
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::packet
EIGEN_DEVICE_FUNC PacketReturnType packet(Index index) const
Definition: TensorCustomOp.h:314
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::m_result
EvaluatorPointerType m_result
Definition: TensorCustomOp.h:341
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::ArgType
TensorCustomUnaryOp< CustomUnaryFunc, XprType > ArgType
Definition: TensorCustomOp.h:83
Eigen::internal::traits< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > >::PointerType
conditional< Pointer_type_promotion< typename LhsXprType::Scalar, Scalar >::val, typename traits< LhsXprType >::PointerType, typename traits< RhsXprType >::PointerType >::type PointerType
Definition: TensorCustomOp.h:199
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::internal::TensorBlockNotImplemented
Definition: TensorBlock.h:617
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorCustomOp.h:282
Eigen::TensorCustomUnaryOp
Tensor custom class.
Definition: TensorCustomOp.h:53
Eigen::CwiseBinaryOp
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:77
Eigen::internal::traits< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > >::CoeffReturnType
internal::promote_storage_type< typename LhsXprType::CoeffReturnType, typename RhsXprType::CoeffReturnType >::ret CoeffReturnType
Definition: TensorCustomOp.h:187
Eigen::TensorCustomUnaryOp::StorageKind
internal::traits< TensorCustomUnaryOp >::StorageKind StorageKind
Definition: TensorCustomOp.h:60
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::m_result
EvaluatorPointerType m_result
Definition: TensorCustomOp.h:168
Eigen::TensorCustomBinaryOp::m_rhs_xpr
RhsXprType::Nested m_rhs_xpr
Definition: TensorCustomOp.h:246
Eigen::internal::nested
Definition: TensorTraits.h:174
Eigen::internal::traits< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > >::Index
promote_index_type< typename traits< LhsXprType >::Index, typename traits< RhsXprType >::Index >::type Index
Definition: TensorCustomOp.h:191
Eigen::TensorCustomBinaryOp::TensorCustomBinaryOp
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorCustomBinaryOp(const LhsXprType &lhs, const RhsXprType &rhs, const CustomBinaryFunc &func)
Definition: TensorCustomOp.h:229
Eigen::internal::traits< TensorCustomUnaryOp< CustomUnaryFunc, XprType > >::StorageKind
XprType::StorageKind StorageKind
Definition: TensorCustomOp.h:27
Eigen::internal::traits< TensorCustomUnaryOp< CustomUnaryFunc, XprType > >::PointerType
traits< XprType >::PointerType PointerType
Definition: TensorCustomOp.h:33
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::evalSubExprsIfNeeded
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType data)
Definition: TensorCustomOp.h:117
Eigen::TensorCustomBinaryOp::Scalar
internal::traits< TensorCustomBinaryOp >::Scalar Scalar
Definition: TensorCustomOp.h:222
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::Scalar
internal::remove_const< typename ArgType::Scalar >::type Scalar
Definition: TensorCustomOp.h:87
ret
DenseIndex ret
Definition: level1_cplx_impl.h:44
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::Storage
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorCustomOp.h:265
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::cleanup
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorCustomOp.h:129
Eigen::internal::nested< TensorCustomUnaryOp< CustomUnaryFunc, XprType > >::type
TensorCustomUnaryOp< CustomUnaryFunc, XprType > type
Definition: TensorCustomOp.h:45
Eigen::TensorEvaluator::Layout
@ Layout
Definition: TensorEvaluator.h:50
Eigen::internal::traits< TensorCustomUnaryOp< CustomUnaryFunc, XprType > >::Scalar
XprType::Scalar Scalar
Definition: TensorCustomOp.h:26
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorCustomOp.h:93
type
Definition: pytypes.h:1491
Eigen::internal::nested< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > >::type
TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > type
Definition: TensorCustomOp.h:211
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorCustomOp.h:89
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::TensorBlock
internal::TensorBlockNotImplemented TensorBlock
Definition: TensorCustomOp.h:279
result
Values result
Definition: OdometryOptimize.cpp:8
Eigen::TensorEvaluator::PacketSize
static const int PacketSize
Definition: TensorEvaluator.h:36
Eigen::internal::traits< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > >::_LhsNested
remove_reference< LhsNested >::type _LhsNested
Definition: TensorCustomOp.h:194
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::Storage
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorCustomOp.h:92
Eigen::DSizes< Index, NumDims >
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::cleanup
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorCustomOp.h:302
Eigen::TensorCustomBinaryOp::m_func
const CustomBinaryFunc m_func
Definition: TensorCustomOp.h:247
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::m_op
const ArgType m_op
Definition: TensorCustomOp.h:166
Eigen::TensorCustomUnaryOp::Index
internal::traits< TensorCustomUnaryOp >::Index Index
Definition: TensorCustomOp.h:61
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::CoeffReturnType
internal::remove_const< typename XprType::CoeffReturnType >::type CoeffReturnType
Definition: TensorCustomOp.h:260
Eigen::TensorCustomBinaryOp::CoeffReturnType
internal::traits< TensorCustomBinaryOp >::CoeffReturnType CoeffReturnType
Definition: TensorCustomOp.h:224
Eigen::PacketType
Definition: TensorMeta.h:50
Eigen::internal::true_type
Definition: Meta.h:96
Eigen::internal::traits< TensorCustomUnaryOp< CustomUnaryFunc, XprType > >::Nested
XprType::Nested Nested
Definition: TensorCustomOp.h:29
Eigen::TensorCustomBinaryOp
Tensor custom class.
Definition: TensorCustomOp.h:219
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::TensorPointerType
Eigen::internal::traits< XprType >::PointerType TensorPointerType
Definition: TensorCustomOp.h:91
Eigen::TensorCustomUnaryOp::Nested
internal::nested< TensorCustomUnaryOp >::type Nested
Definition: TensorCustomOp.h:59
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(const ArgType &op, const Device &device)
Definition: TensorCustomOp.h:109
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::Index
internal::traits< XprType >::Index Index
Definition: TensorCustomOp.h:256
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorCustomOp.h:115
Eigen::internal::traits< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > >::_RhsNested
remove_reference< RhsNested >::type _RhsNested
Definition: TensorCustomOp.h:195
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::costPerCoeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorCustomOp.h:145
Eigen::internal::traits< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > >::LhsNested
LhsXprType::Nested LhsNested
Definition: TensorCustomOp.h:192
Eigen::TensorCustomBinaryOp::rhsExpression
const EIGEN_DEVICE_FUNC internal::remove_all< typename RhsXprType::Nested >::type & rhsExpression() const
Definition: TensorCustomOp.h:242
Eigen::TensorEvaluator::data
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:181
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::Index
internal::traits< ArgType >::Index Index
Definition: TensorCustomOp.h:84
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::Scalar
XprType::Scalar Scalar
Definition: TensorCustomOp.h:259
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
Eigen::TensorEvaluator::PreferBlockAccess
@ PreferBlockAccess
Definition: TensorEvaluator.h:49
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorCustomOp.h:309
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorCustomOp.h:261
Eigen::TensorMap
A tensor expression mapping an existing array of data.
Definition: TensorForwardDeclarations.h:52
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::TensorPointerType
Eigen::internal::traits< XprType >::PointerType TensorPointerType
Definition: TensorCustomOp.h:264
Eigen::TensorCustomUnaryOp::func
const EIGEN_DEVICE_FUNC CustomUnaryFunc & func() const
Definition: TensorCustomOp.h:67
Eigen::TensorCustomUnaryOp::Scalar
internal::traits< TensorCustomUnaryOp >::Scalar Scalar
Definition: TensorCustomOp.h:56
Eigen::internal::traits< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > >::StorageKind
promote_storage_type< typename traits< LhsXprType >::StorageKind, typename traits< RhsXprType >::StorageKind >::ret StorageKind
Definition: TensorCustomOp.h:189
Eigen::internal::eval< TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Eigen::Dense >::type
const typedef TensorCustomUnaryOp< CustomUnaryFunc, XprType > EIGEN_DEVICE_REF type
Definition: TensorCustomOp.h:39
Eigen::internal::promote_storage_type
Definition: XprHelper.h:518
Eigen::Triplet< double >
Eigen::internal::traits< TensorCustomUnaryOp< CustomUnaryFunc, XprType > >::_Nested
remove_reference< Nested >::type _Nested
Definition: TensorCustomOp.h:30
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorCustomOp.h:136
Eigen::TensorEvaluator::m_device
const Device EIGEN_DEVICE_REF m_device
Definition: TensorEvaluator.h:192
Eigen::StorageMemory
Definition: TensorForwardDeclarations.h:37
Eigen::TensorCustomUnaryOp::m_expr
XprType::Nested m_expr
Definition: TensorCustomOp.h:74
Eigen::TensorBase
The tensor base class.
Definition: TensorBase.h:973
Eigen::TensorEvaluator::BlockAccess
@ BlockAccess
Definition: TensorEvaluator.h:48
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::m_device
const Device EIGEN_DEVICE_REF m_device
Definition: TensorCustomOp.h:167
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::m_dimensions
Dimensions m_dimensions
Definition: TensorCustomOp.h:165
Eigen::TensorCustomUnaryOp::CoeffReturnType
XprType::CoeffReturnType CoeffReturnType
Definition: TensorCustomOp.h:58
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::m_op
const XprType m_op
Definition: TensorCustomOp.h:339
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::evalSubExprsIfNeeded
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType data)
Definition: TensorCustomOp.h:290
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::Dimensions
DSizes< Index, NumDims > Dimensions
Definition: TensorCustomOp.h:258
Eigen::internal::traits< TensorCustomUnaryOp< CustomUnaryFunc, XprType > >::Index
XprType::Index Index
Definition: TensorCustomOp.h:28
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::internal::eval< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Eigen::Dense >::type
const typedef TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > & type
Definition: TensorCustomOp.h:205
Eigen::TensorCustomBinaryOp::lhsExpression
const EIGEN_DEVICE_FUNC internal::remove_all< typename LhsXprType::Nested >::type & lhsExpression() const
Definition: TensorCustomOp.h:238
Eigen::TensorCustomBinaryOp::Index
internal::traits< TensorCustomBinaryOp >::Index Index
Definition: TensorCustomOp.h:227
Eigen::TensorCustomBinaryOp::RealScalar
Eigen::NumTraits< Scalar >::Real RealScalar
Definition: TensorCustomOp.h:223
Eigen::internal::conditional
Definition: Meta.h:109
Eigen::TensorCustomUnaryOp::m_func
const CustomUnaryFunc m_func
Definition: TensorCustomOp.h:75
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::evalTo
void evalTo(EvaluatorPointerType data)
Definition: TensorCustomOp.h:333
EIGEN_DEVICE_REF
#define EIGEN_DEVICE_REF
Definition: TensorMacros.h:50
Eigen::internal::traits< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > >::RhsNested
RhsXprType::Nested RhsNested
Definition: TensorCustomOp.h:193
Eigen::internal::traits< TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > >::Scalar
internal::promote_storage_type< typename LhsXprType::Scalar, typename RhsXprType::Scalar >::ret Scalar
Definition: TensorCustomOp.h:185
Eigen::TensorEvaluator
A cost model used to limit the number of threads used for evaluating tensor expression.
Definition: TensorEvaluator.h:28
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::CoeffReturnType
internal::remove_const< typename XprType::CoeffReturnType >::type CoeffReturnType
Definition: TensorCustomOp.h:88
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::packet
EIGEN_DEVICE_FUNC PacketReturnType packet(Index index) const
Definition: TensorCustomOp.h:141
Eigen::TensorCustomBinaryOp::m_lhs_xpr
LhsXprType::Nested m_lhs_xpr
Definition: TensorCustomOp.h:245
internal
Definition: BandTriangularSolver.h:13
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::m_device
const Device EIGEN_DEVICE_REF m_device
Definition: TensorCustomOp.h:340
NULL
#define NULL
Definition: ccolamd.c:609
Eigen::TensorCustomUnaryOp::TensorCustomUnaryOp
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorCustomUnaryOp(const XprType &expr, const CustomUnaryFunc &func)
Definition: TensorCustomOp.h:63
Eigen::TensorEvaluator::IsAligned
@ IsAligned
Definition: TensorEvaluator.h:46
Eigen::internal::promote_index_type
Definition: XprHelper.h:120
func
Definition: benchGeometry.cpp:23
Eigen::internal::eval
Definition: XprHelper.h:332
Eigen::TensorEvaluator::PacketAccess
@ PacketAccess
Definition: TensorEvaluator.h:47
Eigen::TensorCustomBinaryOp::func
const EIGEN_DEVICE_FUNC CustomBinaryFunc & func() const
Definition: TensorCustomOp.h:234
Eigen::TensorCustomBinaryOp::StorageKind
internal::traits< TensorCustomBinaryOp >::StorageKind StorageKind
Definition: TensorCustomOp.h:226
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::evalTo
void evalTo(EvaluatorPointerType data)
Definition: TensorCustomOp.h:160
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorCustomOp.h:288
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::m_dimensions
Dimensions m_dimensions
Definition: TensorCustomOp.h:338
Eigen::TensorOpCost
Definition: TensorCostModel.h:25
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::costPerCoeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorCustomOp.h:318
Eigen::TensorCustomBinaryOp::Nested
internal::nested< TensorCustomBinaryOp >::type Nested
Definition: TensorCustomOp.h:225
Eigen::TensorCustomUnaryOp::RealScalar
Eigen::NumTraits< Scalar >::Real RealScalar
Definition: TensorCustomOp.h:57
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::data
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorCustomOp.h:323
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::data
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorCustomOp.h:150
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::Dimensions
DSizes< Index, NumDims > Dimensions
Definition: TensorCustomOp.h:86
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorCustomOp.h:266
Eigen::TensorEvaluator< const TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType >, Device >::XprType
TensorCustomBinaryOp< CustomBinaryFunc, LhsXprType, RhsXprType > XprType
Definition: TensorCustomOp.h:255
Eigen::TensorEvaluator< const TensorCustomUnaryOp< CustomUnaryFunc, XprType >, Device >::TensorBlock
internal::TensorBlockNotImplemented TensorBlock
Definition: TensorCustomOp.h:106
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::TensorCustomUnaryOp::expression
const EIGEN_DEVICE_FUNC internal::remove_all< typename XprType::Nested >::type & expression() const
Definition: TensorCustomOp.h:71
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Eigen::Dense
Definition: Constants.h:507


gtsam
Author(s):
autogenerated on Sat Jun 1 2024 03:04:54