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 // IWYU pragma: private
14 #include "./InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 
25 namespace internal {
26 template <typename TargetType, typename XprType>
27 struct traits<TensorConversionOp<TargetType, XprType> > {
28  // Type promotion to handle the case where the types of the lhs and the rhs are different.
29  typedef TargetType Scalar;
31  typedef typename traits<XprType>::Index Index;
32  typedef typename XprType::Nested Nested;
33  typedef std::remove_reference_t<Nested> Nested_;
34  static constexpr int NumDimensions = traits<XprType>::NumDimensions;
35  static constexpr int Layout = traits<XprType>::Layout;
36  enum { Flags = 0 };
38 };
39 
40 template <typename TargetType, typename XprType>
41 struct eval<TensorConversionOp<TargetType, XprType>, Eigen::Dense> {
43 };
44 
45 template <typename TargetType, typename XprType>
46 struct nested<TensorConversionOp<TargetType, XprType>, 1,
47  typename eval<TensorConversionOp<TargetType, XprType> >::type> {
49 };
50 
51 } // end namespace internal
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> {
59 
60  template <int LoadMode, typename Index>
62  return internal::pcast<SrcPacket, TgtPacket>(m_impl.template packet<LoadMode>(index));
63  }
64 
65  private:
67 };
68 
69 template <typename TensorEvaluator, typename SrcPacket, typename TgtPacket>
70 struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 2, 1> {
72 
73  template <int LoadMode, typename Index>
75  const int SrcPacketSize = internal::unpacket_traits<SrcPacket>::size;
76 
77  SrcPacket src1 = m_impl.template packet<LoadMode>(index);
78  SrcPacket src2 = m_impl.template packet<LoadMode>(index + SrcPacketSize);
79  TgtPacket result = internal::pcast<SrcPacket, TgtPacket>(src1, src2);
80  return result;
81  }
82 
83  private:
85 };
86 
87 template <typename TensorEvaluator, typename SrcPacket, typename TgtPacket>
88 struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 4, 1> {
90 
91  template <int LoadMode, typename Index>
93  const int SrcPacketSize = internal::unpacket_traits<SrcPacket>::size;
94 
95  SrcPacket src1 = m_impl.template packet<LoadMode>(index);
96  SrcPacket src2 = m_impl.template packet<LoadMode>(index + SrcPacketSize);
97  SrcPacket src3 = m_impl.template packet<LoadMode>(index + 2 * SrcPacketSize);
98  SrcPacket src4 = m_impl.template packet<LoadMode>(index + 3 * SrcPacketSize);
99  TgtPacket result = internal::pcast<SrcPacket, TgtPacket>(src1, src2, src3, src4);
100  return result;
101  }
102 
103  private:
105 };
106 
107 template <typename TensorEvaluator, typename SrcPacket, typename TgtPacket>
108 struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 8, 1> {
110 
111  template <int LoadMode, typename Index>
113  const int SrcPacketSize = internal::unpacket_traits<SrcPacket>::size;
114 
115  SrcPacket src1 = m_impl.template packet<LoadMode>(index);
116  SrcPacket src2 = m_impl.template packet<LoadMode>(index + 1 * SrcPacketSize);
117  SrcPacket src3 = m_impl.template packet<LoadMode>(index + 2 * SrcPacketSize);
118  SrcPacket src4 = m_impl.template packet<LoadMode>(index + 3 * SrcPacketSize);
119  SrcPacket src5 = m_impl.template packet<LoadMode>(index + 4 * SrcPacketSize);
120  SrcPacket src6 = m_impl.template packet<LoadMode>(index + 5 * SrcPacketSize);
121  SrcPacket src7 = m_impl.template packet<LoadMode>(index + 6 * SrcPacketSize);
122  SrcPacket src8 = m_impl.template packet<LoadMode>(index + 7 * SrcPacketSize);
123  TgtPacket result = internal::pcast<SrcPacket, TgtPacket>(src1, src2, src3, src4, src5, src6, src7, src8);
124  return result;
125  }
126 
127  private:
129 };
130 
131 template <typename TensorEvaluator, typename SrcPacket, typename TgtPacket, int TgtCoeffRatio>
132 struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 1, TgtCoeffRatio> {
134  : m_impl(impl), m_maxIndex(impl.dimensions().TotalSize()) {}
135 
136  template <int LoadMode, typename Index>
138  const int SrcPacketSize = internal::unpacket_traits<SrcPacket>::size;
139  // Only call m_impl.packet() when we have direct access to the underlying data. This
140  // ensures that we don't compute the subexpression twice. We may however load some
141  // coefficients twice, but in practice this doesn't negatively impact performance.
142  if (m_impl.data() && (index + SrcPacketSize < m_maxIndex)) {
143  // Force unaligned memory loads since we can't ensure alignment anymore
144  return internal::pcast<SrcPacket, TgtPacket>(m_impl.template packet<Unaligned>(index));
145  } else {
146  const int TgtPacketSize = internal::unpacket_traits<TgtPacket>::size;
147  typedef typename internal::unpacket_traits<SrcPacket>::type SrcType;
148  typedef typename internal::unpacket_traits<TgtPacket>::type TgtType;
150  EIGEN_ALIGN_MAX typename internal::unpacket_traits<TgtPacket>::type values[TgtPacketSize];
152  for (int i = 0; i < TgtPacketSize; ++i) {
153  values[i] = converter(m_impl.coeff(index + i));
154  }
155  TgtPacket rslt = internal::pload<TgtPacket>(values);
156  return rslt;
157  }
158  }
159 
160  private:
163 };
164 
165 template <typename TargetType, typename XprType>
166 class TensorConversionOp : public TensorBase<TensorConversionOp<TargetType, XprType>, ReadOnlyAccessors> {
167  public:
174 
176 
178 
179  protected:
180  typename XprType::Nested m_xpr;
181 };
182 
183 template <bool SameType, typename Eval, typename EvalPointerType>
185  static EIGEN_STRONG_INLINE bool run(Eval& impl, EvalPointerType) {
186  impl.evalSubExprsIfNeeded(NULL);
187  return true;
188  }
189 };
190 
191 template <typename Eval, typename EvalPointerType>
192 struct ConversionSubExprEval<true, Eval, EvalPointerType> {
193  static EIGEN_STRONG_INLINE bool run(Eval& impl, EvalPointerType data) { return impl.evalSubExprsIfNeeded(data); }
194 };
195 
196 #ifdef EIGEN_USE_THREADS
197 template <bool SameType, typename Eval, typename EvalPointerType, typename EvalSubExprsCallback>
198 struct ConversionSubExprEvalAsync {
199  static EIGEN_STRONG_INLINE void run(Eval& impl, EvalPointerType, EvalSubExprsCallback done) {
200  impl.evalSubExprsIfNeededAsync(nullptr, std::move(done));
201  }
202 };
203 
204 template <typename Eval, typename EvalPointerType, typename EvalSubExprsCallback>
205 struct ConversionSubExprEvalAsync<true, Eval, EvalPointerType, EvalSubExprsCallback> {
206  static EIGEN_STRONG_INLINE void run(Eval& impl, EvalPointerType data, EvalSubExprsCallback done) {
207  impl.evalSubExprsIfNeededAsync(data, std::move(done));
208  }
209 };
210 #endif
211 
212 namespace internal {
213 
214 template <typename SrcType, typename TargetType, bool IsSameT>
215 struct CoeffConv {
216  template <typename ArgType, typename Device>
218  Index index) {
220  return converter(impl.coeff(index));
221  }
222 };
223 
224 template <typename SrcType, typename TargetType>
225 struct CoeffConv<SrcType, TargetType, true> {
226  template <typename ArgType, typename Device>
228  Index index) {
229  return impl.coeff(index);
230  }
231 };
232 
233 template <typename SrcPacket, typename TargetPacket, int LoadMode, bool ActuallyVectorize, bool IsSameT>
234 struct PacketConv {
237 
239 
240  template <typename ArgType, typename Device>
242  Index index) {
244  EIGEN_ALIGN_MAX std::remove_const_t<TargetType> values[PacketSize];
246  for (int i = 0; i < PacketSize; ++i) {
247  values[i] = converter(impl.coeff(index + i));
248  }
249  TargetPacket rslt = internal::pload<TargetPacket>(values);
250  return rslt;
251  }
252 };
253 
254 template <typename SrcPacket, typename TargetPacket, int LoadMode, bool IsSameT>
255 struct PacketConv<SrcPacket, TargetPacket, LoadMode, true, IsSameT> {
258 
259  template <typename ArgType, typename Device>
261  Index index) {
264  PacketConverter<TensorEvaluator<ArgType, Device>, SrcPacket, TargetPacket, SrcCoeffRatio, TgtCoeffRatio> converter(
265  impl);
266  return converter.template packet<LoadMode>(index);
267  }
268 };
269 
270 template <typename SrcPacket, typename TargetPacket, int LoadMode>
271 struct PacketConv<SrcPacket, TargetPacket, LoadMode, /*ActuallyVectorize=*/false, /*IsSameT=*/true> {
274 
275  template <typename ArgType, typename Device>
277  Index index) {
278  EIGEN_ALIGN_MAX std::remove_const_t<TargetType> values[PacketSize];
279  for (int i = 0; i < PacketSize; ++i) values[i] = impl.coeff(index + i);
280  return internal::pload<TargetPacket>(values);
281  }
282 };
283 
284 template <typename SrcPacket, typename TargetPacket, int LoadMode>
285 struct PacketConv<SrcPacket, TargetPacket, LoadMode, /*ActuallyVectorize=*/true, /*IsSameT=*/true> {
286  template <typename ArgType, typename Device>
288  Index index) {
289  return impl.template packet<LoadMode>(index);
290  }
291 };
292 
293 } // namespace internal
294 
295 // Eval as rvalue
296 template <typename TargetType, typename ArgType, typename Device>
297 struct TensorEvaluator<const TensorConversionOp<TargetType, ArgType>, Device> {
299  typedef typename XprType::Index Index;
301  typedef TargetType Scalar;
302  typedef TargetType CoeffReturnType;
307  static constexpr bool IsSameType = internal::is_same<TargetType, SrcType>::value;
310 
311  enum {
312  IsAligned = false,
313  PacketAccess =
314 #ifndef EIGEN_USE_SYCL
315  true,
316 #else
319 #endif
322  RawAccess = false
323  };
324 
326  static constexpr int NumDims = internal::array_size<Dimensions>::value;
327 
328  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
331 
333 
334  struct TensorConversionOpBlockFactory {
335  template <typename ArgXprType>
336  struct XprType {
338  };
339 
340  template <typename ArgXprType>
341  typename XprType<ArgXprType>::type expr(const ArgXprType& expr) const {
342  return typename XprType<ArgXprType>::type(expr);
343  }
344  };
345 
347  //===--------------------------------------------------------------------===//
348 
349  EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : m_impl(op.expression(), device) {}
350 
351  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_impl.dimensions(); }
352 
355  }
356 
357 #ifdef EIGEN_USE_THREADS
358  template <typename EvalSubExprsCallback>
359  EIGEN_STRONG_INLINE void evalSubExprsIfNeededAsync(EvaluatorPointerType data, EvalSubExprsCallback done) {
360  ConversionSubExprEvalAsync<IsSameType, TensorEvaluator<ArgType, Device>, EvaluatorPointerType,
361  EvalSubExprsCallback>::run(m_impl, data, std::move(done));
362  }
363 #endif
364 
365  EIGEN_STRONG_INLINE void cleanup() { m_impl.cleanup(); }
366 
369  }
370 
371  template <int LoadMode>
373  // If we are not going to do the cast, we just need to check that base
374  // TensorEvaluator has packet access. Otherwise we also need to make sure,
375  // that we have an implementation of vectorized cast.
376  const bool Vectorizable = IsSameType ? TensorEvaluator<ArgType, Device>::PacketAccess
379 
381  index);
382  }
383 
385  const double cast_cost = TensorOpCost::CastCost<SrcType, TargetType>();
386  if (vectorized) {
389  return m_impl.costPerCoeff(vectorized) * (SrcCoeffRatio / PacketSize) +
390  TensorOpCost(0, 0, TgtCoeffRatio * (cast_cost / PacketSize));
391  } else {
392  return m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, cast_cost);
393  }
394  }
395 
397  return m_impl.getResourceRequirements();
398  }
399 
401  bool /*root_of_expr_ast*/ = false) const {
402  return TensorBlock(m_impl.block(desc, scratch), TensorConversionOpBlockFactory());
403  }
404 
405  EIGEN_DEVICE_FUNC EvaluatorPointerType data() const { return NULL; }
406 
408  const TensorEvaluator<ArgType, Device>& impl() const { return m_impl; }
409 
410  protected:
412 };
413 
414 } // end namespace Eigen
415 
416 #endif // EIGEN_CXX11_TENSOR_TENSOR_CONVERSION_H
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_ALIGN_MAX
Definition: ConfigureVectorization.h:146
#define EIGEN_UNROLL_LOOP
Definition: Macros.h:1298
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
int data[]
Definition: Map_placement_new.cpp:1
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:79
The tensor base class.
Definition: TensorBase.h:1026
Tensor conversion class. This class makes it possible to vectorize type casting operations when the n...
Definition: TensorConversion.h:166
EIGEN_DEVICE_FUNC const internal::remove_all_t< typename XprType::Nested > & expression() const
Definition: TensorConversion.h:177
internal::traits< TensorConversionOp >::StorageKind StorageKind
Definition: TensorConversion.h:169
NumTraits< Scalar >::Real RealScalar
Definition: TensorConversion.h:173
Scalar CoeffReturnType
Definition: TensorConversion.h:172
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorConversionOp(const XprType &xpr)
Definition: TensorConversion.h:175
XprType::Nested m_xpr
Definition: TensorConversion.h:180
internal::traits< TensorConversionOp >::Index Index
Definition: TensorConversion.h:170
internal::traits< TensorConversionOp >::Scalar Scalar
Definition: TensorConversion.h:168
internal::nested< TensorConversionOp >::type Nested
Definition: TensorConversion.h:171
Definition: TensorCostModel.h:28
Definition: TensorBlock.h:604
Definition: TensorBlock.h:834
return int(ret)+1
char char * op
Definition: level2_impl.h:374
typename remove_all< T >::type remove_all_t
Definition: Meta.h:142
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
auto run(Kernel kernel, Args &&... args) -> decltype(kernel(args...))
Definition: gpu_test_helper.h:414
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56
type
Definition: compute_granudrum_aor.py:141
Definition: Eigen_Colamd.h:49
static EIGEN_STRONG_INLINE bool run(Eval &impl, EvalPointerType data)
Definition: TensorConversion.h:193
Definition: TensorConversion.h:184
static EIGEN_STRONG_INLINE bool run(Eval &impl, EvalPointerType)
Definition: TensorConversion.h:185
Definition: Constants.h:519
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketConverter(const TensorEvaluator &impl)
Definition: TensorConversion.h:58
const TensorEvaluator & m_impl
Definition: TensorConversion.h:66
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const
Definition: TensorConversion.h:61
const TensorEvaluator & m_impl
Definition: TensorConversion.h:161
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketConverter(const TensorEvaluator &impl)
Definition: TensorConversion.h:133
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const
Definition: TensorConversion.h:137
const TensorEvaluator::Index m_maxIndex
Definition: TensorConversion.h:162
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketConverter(const TensorEvaluator &impl)
Definition: TensorConversion.h:71
const TensorEvaluator & m_impl
Definition: TensorConversion.h:84
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const
Definition: TensorConversion.h:74
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const
Definition: TensorConversion.h:92
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketConverter(const TensorEvaluator &impl)
Definition: TensorConversion.h:89
const TensorEvaluator & m_impl
Definition: TensorConversion.h:104
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketConverter(const TensorEvaluator &impl)
Definition: TensorConversion.h:109
const TensorEvaluator & m_impl
Definition: TensorConversion.h:128
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket packet(Index index) const
Definition: TensorConversion.h:112
Definition: TensorConversion.h:54
Definition: TensorMeta.h:47
Definition: TensorForwardDeclarations.h:42
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorConversion.h:308
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorConversion.h:384
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorConversion.h:365
PacketType< SrcType, Device >::type PacketSourceType
Definition: TensorConversion.h:305
internal::TensorBlockDescriptor< NumDims, Index > TensorBlockDesc
Definition: TensorConversion.h:329
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorConversion.h:367
const TensorEvaluator< ArgType, Device > & impl() const
required by sycl in order to extract the sycl accessor
Definition: TensorConversion.h:408
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorConversion.h:304
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorConversion.h:330
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType data)
Definition: TensorConversion.h:353
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorConversion.h:405
TensorEvaluator< ArgType, Device > m_impl
Definition: TensorConversion.h:411
TensorConversionOp< TargetType, ArgType > XprType
Definition: TensorConversion.h:298
internal::TensorUnaryExprBlock< TensorConversionOpBlockFactory, ArgTensorBlock > TensorBlock
Definition: TensorConversion.h:346
internal::remove_all_t< typename internal::traits< ArgType >::Scalar > SrcType
Definition: TensorConversion.h:303
TensorEvaluator< const ArgType, Device >::TensorBlock ArgTensorBlock
Definition: TensorConversion.h:332
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorConversion.h:349
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition: TensorConversion.h:396
TensorEvaluator< ArgType, Device >::Dimensions Dimensions
Definition: TensorConversion.h:300
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorConversion.h:372
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions & dimensions() const
Definition: TensorConversion.h:351
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition: TensorConversion.h:400
TensorConversionOp< TargetType, const ArgXprType > type
Definition: TensorConversion.h:337
XprType< ArgXprType >::type expr(const ArgXprType &expr) const
Definition: TensorConversion.h:341
A cost model used to limit the number of threads used for evaluating tensor expression.
Definition: TensorEvaluator.h:31
static constexpr int Layout
Definition: TensorEvaluator.h:46
Storage::Type EvaluatorPointerType
Definition: TensorEvaluator.h:41
@ PacketAccess
Definition: TensorEvaluator.h:50
@ IsAligned
Definition: TensorEvaluator.h:49
static constexpr int PacketSize
Definition: TensorEvaluator.h:38
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:165
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:89
Derived::Index Index
Definition: TensorEvaluator.h:32
internal::TensorMaterializedBlock< ScalarNoConst, NumCoords, Layout, Index > TensorBlock
Definition: TensorEvaluator.h:63
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetType run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:227
Definition: TensorConversion.h:215
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetType run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:217
internal::unpacket_traits< TargetPacket >::type TargetType
Definition: TensorConversion.h:272
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetPacket run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:276
internal::unpacket_traits< TargetPacket >::type TargetType
Definition: TensorConversion.h:257
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetPacket run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:260
internal::unpacket_traits< SrcPacket >::type SrcType
Definition: TensorConversion.h:256
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetPacket run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:287
Definition: TensorConversion.h:234
internal::unpacket_traits< TargetPacket >::type TargetType
Definition: TensorConversion.h:236
internal::unpacket_traits< SrcPacket >::type SrcType
Definition: TensorConversion.h:235
static constexpr int PacketSize
Definition: TensorConversion.h:238
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TargetPacket run(const TensorEvaluator< ArgType, Device > &impl, Index index)
Definition: TensorConversion.h:241
Definition: TensorForwardDeclarations.h:54
Definition: Meta.h:305
const TensorConversionOp< TargetType, XprType > & type
Definition: TensorConversion.h:42
Definition: XprHelper.h:427
Definition: Meta.h:205
Definition: TensorTraits.h:152
ref_selector< T >::type type
Definition: TensorTraits.h:153
Template functor to cast a scalar to another type.
Definition: functors/UnaryFunctors.h:205
traits< XprType >::Index Index
Definition: TensorConversion.h:31
XprType::Nested Nested
Definition: TensorConversion.h:32
TypeConversion< Scalar, typename traits< XprType >::PointerType >::type PointerType
Definition: TensorConversion.h:37
std::remove_reference_t< Nested > Nested_
Definition: TensorConversion.h:33
traits< XprType >::StorageKind StorageKind
Definition: TensorConversion.h:30
Definition: ForwardDeclarations.h:21
Definition: GenericPacketMath.h:201
Definition: GenericPacketMath.h:134
Definition: ZVector/PacketMath.h:50