TensorConversion.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) 2015 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_CONVERSION_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_CONVERSION_H
12 
13 namespace Eigen {
14 
22 namespace internal {
23 template<typename TargetType, typename XprType>
24 struct traits<TensorConversionOp<TargetType, XprType> >
25 {
26  // Type promotion to handle the case where the types of the lhs and the rhs are different.
27  typedef TargetType Scalar;
29  typedef typename traits<XprType>::Index Index;
30  typedef typename XprType::Nested Nested;
32  static const int NumDimensions = traits<XprType>::NumDimensions;
33  static const int Layout = traits<XprType>::Layout;
34  enum { Flags = 0 };
36 };
37 
38 template<typename TargetType, typename XprType>
39 struct eval<TensorConversionOp<TargetType, XprType>, Eigen::Dense>
40 {
42 };
43 
44 template<typename TargetType, typename XprType>
45 struct nested<TensorConversionOp<TargetType, XprType>, 1, typename eval<TensorConversionOp<TargetType, XprType> >::type>
46 {
48 };
49 
50 } // end namespace internal
51 
52 
53 template <typename TensorEvaluator, typename SrcPacket, typename TgtPacket, int SrcCoeffRatio, int TgtCoeffRatio>
55 
56 template <typename TensorEvaluator, typename SrcPacket, typename TgtPacket>
57 struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 1, 1> {
60  : m_impl(impl) {}
61 
62  template<int LoadMode, typename Index>
64  return internal::pcast<SrcPacket, TgtPacket>(m_impl.template packet<LoadMode>(index));
65  }
66 
67  private:
69 };
70 
71 
72 template <typename TensorEvaluator, typename SrcPacket, typename TgtPacket>
73 struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 2, 1> {
76  : m_impl(impl) {}
77 
78  template<int LoadMode, typename Index>
80  const int SrcPacketSize = internal::unpacket_traits<SrcPacket>::size;
81 
82  SrcPacket src1 = m_impl.template packet<LoadMode>(index);
83  SrcPacket src2 = m_impl.template packet<LoadMode>(index + SrcPacketSize);
84  TgtPacket result = internal::pcast<SrcPacket, TgtPacket>(src1, src2);
85  return result;
86  }
87 
88  private:
90 };
91 
92 template <typename TensorEvaluator, typename SrcPacket, typename TgtPacket>
93 struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 4, 1> {
96  : m_impl(impl) {}
97 
98  template<int LoadMode, typename Index>
100  const int SrcPacketSize = internal::unpacket_traits<SrcPacket>::size;
101 
102  SrcPacket src1 = m_impl.template packet<LoadMode>(index);
103  SrcPacket src2 = m_impl.template packet<LoadMode>(index + SrcPacketSize);
104  SrcPacket src3 = m_impl.template packet<LoadMode>(index + 2 * SrcPacketSize);
105  SrcPacket src4 = m_impl.template packet<LoadMode>(index + 3 * SrcPacketSize);
106  TgtPacket result = internal::pcast<SrcPacket, TgtPacket>(src1, src2, src3, src4);
107  return result;
108  }
109 
110  private:
112 };
113 
114 template <typename TensorEvaluator, typename SrcPacket, typename TgtPacket>
115 struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 8, 1> {
118  : m_impl(impl) {}
119 
120  template<int LoadMode, typename Index>
122  const int SrcPacketSize = internal::unpacket_traits<SrcPacket>::size;
123 
124  SrcPacket src1 = m_impl.template packet<LoadMode>(index);
125  SrcPacket src2 = m_impl.template packet<LoadMode>(index + 1 * SrcPacketSize);
126  SrcPacket src3 = m_impl.template packet<LoadMode>(index + 2 * SrcPacketSize);
127  SrcPacket src4 = m_impl.template packet<LoadMode>(index + 3 * SrcPacketSize);
128  SrcPacket src5 = m_impl.template packet<LoadMode>(index + 4 * SrcPacketSize);
129  SrcPacket src6 = m_impl.template packet<LoadMode>(index + 5 * SrcPacketSize);
130  SrcPacket src7 = m_impl.template packet<LoadMode>(index + 6 * SrcPacketSize);
131  SrcPacket src8 = m_impl.template packet<LoadMode>(index + 7 * SrcPacketSize);
132  TgtPacket result = internal::pcast<SrcPacket, TgtPacket>(src1, src2, src3, src4, src5, src6, src7, src8);
133  return result;
134  }
135 
136  private:
138 };
139 
140 template <typename TensorEvaluator, typename SrcPacket, typename TgtPacket, int TgtCoeffRatio>
141 struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 1, TgtCoeffRatio> {
144  : m_impl(impl), m_maxIndex(impl.dimensions().TotalSize()) {}
145 
146  template<int LoadMode, typename Index>
148  const int SrcPacketSize = internal::unpacket_traits<SrcPacket>::size;
149  // Only call m_impl.packet() when we have direct access to the underlying data. This
150  // ensures that we don't compute the subexpression twice. We may however load some
151  // coefficients twice, but in practice this doesn't negatively impact performance.
152  if (m_impl.data() && (index + SrcPacketSize < m_maxIndex)) {
153  // Force unaligned memory loads since we can't ensure alignment anymore
154  return internal::pcast<SrcPacket, TgtPacket>(m_impl.template packet<Unaligned>(index));
155  } else {
156  const int TgtPacketSize = internal::unpacket_traits<TgtPacket>::size;
157  typedef typename internal::unpacket_traits<SrcPacket>::type SrcType;
158  typedef typename internal::unpacket_traits<TgtPacket>::type TgtType;
162  for (int i = 0; i < TgtPacketSize; ++i) {
163  values[i] = converter(m_impl.coeff(index+i));
164  }
165  TgtPacket rslt = internal::pload<TgtPacket>(values);
166  return rslt;
167  }
168  }
169 
170  private:
173 };
174 
175 template<typename TargetType, typename XprType>
176 class TensorConversionOp : public TensorBase<TensorConversionOp<TargetType, XprType>, ReadOnlyAccessors>
177 {
178  public:
185 
187  : m_xpr(xpr) {}
188 
191  expression() const { return m_xpr; }
192 
193  protected:
194  typename XprType::Nested m_xpr;
195 };
196 
197 template <bool SameType, typename Eval, typename EvalPointerType> struct ConversionSubExprEval {
198  static EIGEN_STRONG_INLINE bool run(Eval& impl, EvalPointerType) {
199  impl.evalSubExprsIfNeeded(NULL);
200  return true;
201  }
202 };
203 
204 template <typename Eval, typename EvalPointerType> struct ConversionSubExprEval<true, Eval, EvalPointerType> {
205  static EIGEN_STRONG_INLINE bool run(Eval& impl, EvalPointerType data) {
206  return impl.evalSubExprsIfNeeded(data);
207  }
208 };
209 
210 #ifdef EIGEN_USE_THREADS
211 template <bool SameType, typename Eval, typename EvalPointerType,
212  typename EvalSubExprsCallback>
213 struct ConversionSubExprEvalAsync {
214  static EIGEN_STRONG_INLINE void run(Eval& impl, EvalPointerType, EvalSubExprsCallback done) {
215  impl.evalSubExprsIfNeededAsync(nullptr, std::move(done));
216  }
217 };
218 
219 template <typename Eval, typename EvalPointerType,
220  typename EvalSubExprsCallback>
221 struct ConversionSubExprEvalAsync<true, Eval, EvalPointerType,
222  EvalSubExprsCallback> {
223  static EIGEN_STRONG_INLINE void run(Eval& impl, EvalPointerType data, EvalSubExprsCallback done) {
224  impl.evalSubExprsIfNeededAsync(data, std::move(done));
225  }
226 };
227 #endif
228 
229 namespace internal {
230 
231 template <typename SrcType, typename TargetType, bool IsSameT>
232 struct CoeffConv {
233  template <typename ArgType, typename Device>
236  return converter(impl.coeff(index));
237  }
238 };
239 
240 template <typename SrcType, typename TargetType>
241 struct CoeffConv<SrcType, TargetType, true> {
242  template <typename ArgType, typename Device>
244  return impl.coeff(index);
245  }
246 };
247 
248 template <typename SrcPacket, typename TargetPacket, int LoadMode, bool ActuallyVectorize, bool IsSameT>
249 struct PacketConv {
252 
254 
255  template <typename ArgType, typename Device>
260  for (int i = 0; i < PacketSize; ++i) {
261  values[i] = converter(impl.coeff(index+i));
262  }
263  TargetPacket rslt = internal::pload<TargetPacket>(values);
264  return rslt;
265  }
266 };
267 
268 template <typename SrcPacket, typename TargetPacket, int LoadMode, bool IsSameT>
269 struct PacketConv<SrcPacket, TargetPacket, LoadMode, true, IsSameT> {
272 
273  template <typename ArgType, typename Device>
277  PacketConverter<TensorEvaluator<ArgType, Device>, SrcPacket, TargetPacket,
278  SrcCoeffRatio, TgtCoeffRatio> converter(impl);
279  return converter.template packet<LoadMode>(index);
280  }
281 };
282 
283 template <typename SrcPacket, typename TargetPacket, int LoadMode>
284 struct PacketConv<SrcPacket, TargetPacket, LoadMode, /*ActuallyVectorize=*/false, /*IsSameT=*/true> {
287 
288  template <typename ArgType, typename Device>
291  for (int i = 0; i < PacketSize; ++i) values[i] = impl.coeff(index+i);
292  return internal::pload<TargetPacket>(values);
293  }
294 };
295 
296 template <typename SrcPacket, typename TargetPacket, int LoadMode>
297 struct PacketConv<SrcPacket, TargetPacket, LoadMode, /*ActuallyVectorize=*/true, /*IsSameT=*/true> {
298  template <typename ArgType, typename Device>
300  return impl.template packet<LoadMode>(index);
301  }
302 };
303 
304 } // namespace internal
305 
306 // Eval as rvalue
307 template<typename TargetType, typename ArgType, typename Device>
308 struct TensorEvaluator<const TensorConversionOp<TargetType, ArgType>, Device>
309 {
311  typedef typename XprType::Index Index;
313  typedef TargetType Scalar;
314  typedef TargetType CoeffReturnType;
319  static const bool IsSameType = internal::is_same<TargetType, SrcType>::value;
322 
323  enum {
324  IsAligned = false,
326  #ifndef EIGEN_USE_SYCL
327  true,
328  #else
331  #endif
335  RawAccess = false
336  };
337 
338  static const int NumDims = internal::array_size<Dimensions>::value;
339 
340  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
343 
346 
347  struct TensorConversionOpBlockFactory {
348  template <typename ArgXprType>
349  struct XprType {
351  };
352 
353  template <typename ArgXprType>
354  typename XprType<ArgXprType>::type expr(const ArgXprType& expr) const {
355  return typename XprType<ArgXprType>::type(expr);
356  }
357  };
358 
359  typedef internal::TensorUnaryExprBlock<TensorConversionOpBlockFactory,
360  ArgTensorBlock>
362  //===--------------------------------------------------------------------===//
363 
364  EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device)
365  : m_impl(op.expression(), device)
366  {
367  }
368 
369  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_impl.dimensions(); }
370 
372  {
374  }
375 
376 #ifdef EIGEN_USE_THREADS
377  template <typename EvalSubExprsCallback>
378  EIGEN_STRONG_INLINE void evalSubExprsIfNeededAsync(
379  EvaluatorPointerType data, EvalSubExprsCallback done) {
380  ConversionSubExprEvalAsync<IsSameType, TensorEvaluator<ArgType, Device>,
382  EvalSubExprsCallback>::run(m_impl, data, std::move(done));
383  }
384 #endif
385 
387  {
388  m_impl.cleanup();
389  }
390 
392  {
394  }
395 
396  template<int LoadMode>
398  packet(Index index) const {
399  // If we are not going to do the cast, we just need to check that base
400  // TensorEvaluator has packet access. Otherwise we also need to make sure,
401  // that we have an implementation of vectorized cast.
402  const bool Vectorizable =
403  IsSameType
407 
409  Vectorizable, IsSameType>::run(m_impl, index);
410  }
411 
413  costPerCoeff(bool vectorized) const {
414  const double cast_cost = TensorOpCost::CastCost<SrcType, TargetType>();
415  if (vectorized) {
416  const double SrcCoeffRatio =
418  const double TgtCoeffRatio =
420  return m_impl.costPerCoeff(vectorized) * (SrcCoeffRatio / PacketSize) +
421  TensorOpCost(0, 0, TgtCoeffRatio * (cast_cost / PacketSize));
422  } else {
423  return m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, cast_cost);
424  }
425  }
426 
429  return m_impl.getResourceRequirements();
430  }
431 
434  bool /*root_of_expr_ast*/ = false) const {
435  return TensorBlock(m_impl.block(desc, scratch),
436  TensorConversionOpBlockFactory());
437  }
438 
440 
442  const TensorEvaluator<ArgType, Device>& impl() const { return m_impl; }
443 #ifdef EIGEN_USE_SYCL
444  // binding placeholder accessors to a command group handler for SYCL
445  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void bind(cl::sycl::handler &cgh) const {
446  m_impl.bind(cgh);
447  }
448 #endif
449 
450  protected:
452 };
453 
454 } // end namespace Eigen
455 
456 #endif // EIGEN_CXX11_TENSOR_TENSOR_CONVERSION_H
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::TensorConversionOpBlockFactory::XprType::type
TensorConversionOp< TargetType, const ArgXprType > type
Definition: TensorConversion.h:350
gtsam.examples.DogLegOptimizerExample.int
int
Definition: DogLegOptimizerExample.py:111
Eigen::internal::traits< TensorConversionOp< TargetType, XprType > >::StorageKind
traits< XprType >::StorageKind StorageKind
Definition: TensorConversion.h:28
Eigen::internal::TensorBlockScratchAllocator
Definition: TensorBlock.h:525
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 1, TgtCoeffRatio >::m_impl
const TensorEvaluator & m_impl
Definition: TensorConversion.h:171
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::PacketSourceType
PacketType< SrcType, Device >::type PacketSourceType
Definition: TensorConversion.h:317
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 8, 1 >::PacketConverter
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketConverter(const TensorEvaluator &impl)
Definition: TensorConversion.h:117
Eigen::internal::traits< TensorConversionOp< TargetType, XprType > >::_Nested
remove_reference< Nested >::type _Nested
Definition: TensorConversion.h:31
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
dimensions
const std::vector< size_t > dimensions
Definition: testVerticalBlockMatrix.cpp:27
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::Scalar
TargetType Scalar
Definition: TensorConversion.h:313
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::CoeffReturnType
TargetType CoeffReturnType
Definition: TensorConversion.h:314
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 1, TgtCoeffRatio >::PacketConverter
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketConverter(const TensorEvaluator &impl)
Definition: TensorConversion.h:143
gtsam.examples.DogLegOptimizerExample.type
type
Definition: DogLegOptimizerExample.py:111
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 2, 1 >::PacketConverter
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketConverter(const TensorEvaluator &impl)
Definition: TensorConversion.h:75
Eigen::internal::traits< TensorConversionOp< TargetType, XprType > >::Nested
XprType::Nested Nested
Definition: TensorConversion.h:30
Eigen::CwiseBinaryOp
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:77
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::ArgTensorBlock
TensorEvaluator< const ArgType, Device >::TensorBlock ArgTensorBlock
Definition: TensorConversion.h:345
Eigen::internal::TypeConversion
Definition: TensorForwardDeclarations.h:46
Eigen::internal::remove_all
Definition: Meta.h:126
Eigen::internal::CoeffConv< SrcType, TargetType, true >::run
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetType run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:243
Eigen::internal::nested
Definition: TensorTraits.h:174
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 4, 1 >::m_impl
const TensorEvaluator & m_impl
Definition: TensorConversion.h:111
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::cleanup
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorConversion.h:386
Eigen::TensorConversionOp::TensorConversionOp
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorConversionOp(const XprType &xpr)
Definition: TensorConversion.h:186
Eigen::TensorConversionOp::CoeffReturnType
Scalar CoeffReturnType
Definition: TensorConversion.h:183
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorConversion.h:321
Eigen::TensorEvaluator::TensorBlock
internal::TensorMaterializedBlock< ScalarNoConst, NumCoords, Layout, Index > TensorBlock
Definition: TensorEvaluator.h:63
Eigen::internal::CoeffConv::run
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetType run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:234
Eigen::internal::scalar_cast_op
Definition: UnaryFunctors.h:160
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 1, TgtCoeffRatio >::m_maxIndex
const TensorEvaluator::Index m_maxIndex
Definition: TensorConversion.h:172
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::Index
XprType::Index Index
Definition: TensorConversion.h:311
Eigen::TensorEvaluator::Index
Derived::Index Index
Definition: TensorEvaluator.h:30
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 2, 1 >::packet
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const
Definition: TensorConversion.h:79
Eigen::TensorEvaluator::Layout
@ Layout
Definition: TensorEvaluator.h:50
Eigen::internal::PacketConv< SrcPacket, TargetPacket, LoadMode, true, IsSameT >::TargetType
internal::unpacket_traits< TargetPacket >::type TargetType
Definition: TensorConversion.h:271
type
Definition: pytypes.h:1491
Eigen::internal::TensorMaterializedBlock
Definition: TensorBlock.h:656
Eigen::internal::traits< TensorConversionOp< TargetType, XprType > >::Index
traits< XprType >::Index Index
Definition: TensorConversion.h:29
Eigen::TensorConversionOp::expression
const EIGEN_DEVICE_FUNC internal::remove_all< typename XprType::Nested >::type & expression() const
Definition: TensorConversion.h:191
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::costPerCoeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorConversion.h:413
result
Values result
Definition: OdometryOptimize.cpp:8
Eigen::TensorEvaluator::PacketSize
static const int PacketSize
Definition: TensorEvaluator.h:36
Eigen::internal::CoeffConv
Definition: TensorConversion.h:232
Eigen::internal::eval< TensorConversionOp< TargetType, XprType >, Eigen::Dense >::type
const typedef TensorConversionOp< TargetType, XprType > & type
Definition: TensorConversion.h:41
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 1, 1 >::PacketConverter
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketConverter(const TensorEvaluator &impl)
Definition: TensorConversion.h:59
EIGEN_ALIGN_MAX
#define EIGEN_ALIGN_MAX
Definition: ConfigureVectorization.h:157
Eigen::internal::PacketConv::SrcType
internal::unpacket_traits< SrcPacket >::type SrcType
Definition: TensorConversion.h:250
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::TensorBlock
internal::TensorUnaryExprBlock< TensorConversionOpBlockFactory, ArgTensorBlock > TensorBlock
Definition: TensorConversion.h:361
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 1, TgtCoeffRatio >::packet
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const
Definition: TensorConversion.h:147
Eigen::PacketType
Definition: TensorMeta.h:50
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::XprType
TensorConversionOp< TargetType, ArgType > XprType
Definition: TensorConversion.h:310
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::evalSubExprsIfNeeded
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType data)
Definition: TensorConversion.h:371
Eigen::internal::TensorBlockDescriptor< NumDims, Index >
Eigen::internal::true_type
Definition: Meta.h:96
Eigen::internal::traits< TensorConversionOp< TargetType, XprType > >::PointerType
TypeConversion< Scalar, typename traits< XprType >::PointerType >::type PointerType
Definition: TensorConversion.h:35
Eigen::internal::PacketConv
Definition: TensorConversion.h:249
data
int data[]
Definition: Map_placement_new.cpp:1
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::m_impl
TensorEvaluator< ArgType, Device > m_impl
Definition: TensorConversion.h:451
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 8, 1 >::packet
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const
Definition: TensorConversion.h:121
Eigen::internal::PacketConv::run
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetPacket run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:256
Eigen::TensorConversionOp::StorageKind
internal::traits< TensorConversionOp >::StorageKind StorageKind
Definition: TensorConversion.h:180
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 4, 1 >::packet
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const
Definition: TensorConversion.h:99
Eigen::TensorEvaluator::data
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:181
Eigen::internal::unpacket_traits
Definition: GenericPacketMath.h:132
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
EIGEN_UNROLL_LOOP
#define EIGEN_UNROLL_LOOP
Definition: Macros.h:1461
Eigen::ConversionSubExprEval< true, Eval, EvalPointerType >::run
static EIGEN_STRONG_INLINE bool run(Eval &impl, EvalPointerType data)
Definition: TensorConversion.h:205
Eigen::TensorEvaluator::PreferBlockAccess
@ PreferBlockAccess
Definition: TensorEvaluator.h:49
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 8, 1 >::m_impl
const TensorEvaluator & m_impl
Definition: TensorConversion.h:137
gtsam.examples.DogLegOptimizerExample.run
def run(args)
Definition: DogLegOptimizerExample.py:21
Eigen::internal::nested< TensorConversionOp< TargetType, XprType >, 1, typename eval< TensorConversionOp< TargetType, XprType > >::type >::type
TensorConversionOp< TargetType, XprType > type
Definition: TensorConversion.h:47
Eigen::internal::Packet
Definition: ZVector/PacketMath.h:47
Eigen::Triplet< double >
Eigen::StorageMemory
Definition: TensorForwardDeclarations.h:37
Eigen::internal::PacketConv< SrcPacket, TargetPacket, LoadMode, true, true >::run
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetPacket run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:299
Eigen::TensorConversionOp
Tensor conversion class. This class makes it possible to vectorize type casting operations when the n...
Definition: TensorConversion.h:176
Eigen::TensorBase
The tensor base class.
Definition: TensorBase.h:973
Eigen::internal::PacketConv< SrcPacket, TargetPacket, LoadMode, false, true >::run
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetPacket run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:289
Eigen::internal::array_size
Definition: Meta.h:445
Eigen::internal::TensorUnaryExprBlock
Definition: TensorBlock.h:912
Eigen::TensorEvaluator::BlockAccess
@ BlockAccess
Definition: TensorEvaluator.h:48
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 4, 1 >::PacketConverter
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketConverter(const TensorEvaluator &impl)
Definition: TensorConversion.h:95
Eigen::ConversionSubExprEval
Definition: TensorConversion.h:197
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::impl
const TensorEvaluator< ArgType, Device > & impl() const
required by sycl in order to extract the sycl accessor
Definition: TensorConversion.h:442
Eigen::internal::PacketConv< SrcPacket, TargetPacket, LoadMode, false, true >::TargetType
internal::unpacket_traits< TargetPacket >::type TargetType
Definition: TensorConversion.h:285
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::TensorBlockScratch
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorConversion.h:342
Eigen::TensorConversionOp::Scalar
internal::traits< TensorConversionOp >::Scalar Scalar
Definition: TensorConversion.h:179
leaf::values
leaf::MyValues values
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 1, 1 >::packet
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const
Definition: TensorConversion.h:63
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::TensorBlockDesc
internal::TensorBlockDescriptor< NumDims, Index > TensorBlockDesc
Definition: TensorConversion.h:341
Eigen::TensorEvaluator::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorEvaluator.h:39
Eigen::internal::type_casting_traits
Definition: GenericPacketMath.h:148
Eigen::internal::TensorBlockResourceRequirements
Definition: TensorBlock.h:75
Eigen::ConversionSubExprEval::run
static EIGEN_STRONG_INLINE bool run(Eval &impl, EvalPointerType)
Definition: TensorConversion.h:198
Eigen::TensorEvaluator::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:94
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::Storage
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorConversion.h:320
Eigen::TensorConversionOp::Index
internal::traits< TensorConversionOp >::Index Index
Definition: TensorConversion.h:181
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::packet
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorConversion.h:398
Eigen::TensorEvaluator
A cost model used to limit the number of threads used for evaluating tensor expression.
Definition: TensorEvaluator.h:28
Eigen::internal::is_same
Definition: Meta.h:148
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::Dimensions
TensorEvaluator< ArgType, Device >::Dimensions Dimensions
Definition: TensorConversion.h:312
Eigen::TensorConversionOp::m_xpr
XprType::Nested m_xpr
Definition: TensorConversion.h:194
internal
Definition: BandTriangularSolver.h:13
NULL
#define NULL
Definition: ccolamd.c:609
Eigen::internal::PacketConv< SrcPacket, TargetPacket, LoadMode, true, IsSameT >::SrcType
internal::unpacket_traits< SrcPacket >::type SrcType
Definition: TensorConversion.h:270
Eigen::TensorEvaluator::IsAligned
@ IsAligned
Definition: TensorEvaluator.h:46
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::SrcType
internal::remove_all< typename internal::traits< ArgType >::Scalar >::type SrcType
Definition: TensorConversion.h:315
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::data
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorConversion.h:439
Eigen::TensorConversionOp::Nested
internal::nested< TensorConversionOp >::type Nested
Definition: TensorConversion.h:182
Eigen::internal::traits< TensorConversionOp< TargetType, XprType > >::Scalar
TargetType Scalar
Definition: TensorConversion.h:27
Eigen::TensorConversionOp::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: TensorConversion.h:184
Eigen::internal::eval
Definition: XprHelper.h:332
Eigen::TensorEvaluator::PacketAccess
@ PacketAccess
Definition: TensorEvaluator.h:47
Eigen::TensorEvaluator::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorEvaluator.h:33
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 1, 1 >::m_impl
const TensorEvaluator & m_impl
Definition: TensorConversion.h:68
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorConversion.h:316
Eigen::TensorOpCost
Definition: TensorCostModel.h:25
Eigen::PacketConverter
Definition: TensorConversion.h:54
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::TensorConversionOpBlockFactory::expr
XprType< ArgXprType >::type expr(const ArgXprType &expr) const
Definition: TensorConversion.h:354
Eigen::TensorBase< TensorConversionOp< TargetType, Eigen::CwiseBinaryOp >, ReadOnlyAccessors >::Scalar
DerivedTraits::Scalar Scalar
Definition: TensorBase.h:977
Eigen::internal::PacketConv< SrcPacket, TargetPacket, LoadMode, true, IsSameT >::run
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetPacket run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:274
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::getResourceRequirements
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition: TensorConversion.h:428
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::block
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition: TensorConversion.h:433
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorConversion.h:369
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorConversion.h:391
Eigen::internal::PacketConv::PacketSize
static const int PacketSize
Definition: TensorConversion.h:253
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Eigen::internal::PacketConv::TargetType
internal::unpacket_traits< TargetPacket >::type TargetType
Definition: TensorConversion.h:251
Eigen::Dense
Definition: Constants.h:507
Eigen::TensorEvaluator< const TensorConversionOp< TargetType, ArgType >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorConversion.h:364
Eigen::PacketConverter< TensorEvaluator, SrcPacket, TgtPacket, 2, 1 >::m_impl
const TensorEvaluator & m_impl
Definition: TensorConversion.h:89


gtsam
Author(s):
autogenerated on Tue Jun 25 2024 03:04:09