10#ifndef EIGEN_CXX11_TENSOR_TENSOR_EVAL_TO_H
11#define EIGEN_CXX11_TENSOR_TENSOR_EVAL_TO_H
23template<
typename XprType,
template <
class>
class MakePointer_>
27 typedef typename XprType::Scalar
Scalar;
30 typedef typename XprTraits::Index
Index;
31 typedef typename XprType::Nested
Nested;
33 static const int NumDimensions = XprTraits::NumDimensions;
34 static const int Layout = XprTraits::Layout;
44 typedef typename MakePointerT::Type
Type;
50template<
typename XprType,
template <
class>
class MakePointer_>
56template<
typename XprType,
template <
class>
class MakePointer_>
67template<
typename XprType,
template <
class>
class MakePointer_>
74 typedef typename MakePointer_<CoeffReturnType>::Type
PointerType;
97template<
typename ArgType,
typename Device,
template <
class>
class MakePointer_>
135 : m_impl(op.expression(), device), m_buffer(device.
get(op.buffer())), m_expression(op.expression()){}
147 return m_impl.evalSubExprsIfNeeded(m_buffer);
150#ifdef EIGEN_USE_THREADS
151 template <
typename EvalSubExprsCallback>
156 m_impl.evalSubExprsIfNeededAsync(m_buffer, std::move(done));
161 m_buffer[
i] = m_impl.coeff(
i);
169 return m_impl.getResourceRequirements();
175 desc.template AddDestinationBuffer<Layout>(
180 m_impl.block(desc, scratch,
true);
185 TensorBlockAssignment::Run(
186 TensorBlockAssignment::target(
200 return m_buffer[index];
203 template<
int LoadMode>
212 return m_impl.costPerCoeff(vectorized) +
218 #ifdef EIGEN_USE_SYCL
228 TensorEvaluator<ArgType, Device> m_impl;
230 const ArgType m_expression;
int i
Definition BiCGSTAB_step_by_step.cpp:9
#define EIGEN_UNUSED_VARIABLE(var)
Definition Macros.h:1076
#define EIGEN_DEVICE_FUNC
Definition Macros.h:976
#define eigen_assert(x)
Definition Macros.h:1037
#define EIGEN_STRONG_INLINE
Definition Macros.h:917
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition CwiseBinaryOp.h:84
The tensor base class.
Definition TensorBase.h:973
Definition TensorEvalTo.h:69
XprType::Nested m_xpr
Definition TensorEvalTo.h:91
EIGEN_DEVICE_FUNC const internal::remove_all< typenameXprType::Nested >::type & expression() const
Definition TensorEvalTo.h:86
internal::remove_const< typenameXprType::CoeffReturnType >::type CoeffReturnType
Definition TensorEvalTo.h:73
Eigen::internal::traits< TensorEvalToOp >::StorageKind StorageKind
Definition TensorEvalTo.h:76
MakePointer_< CoeffReturnType >::Type PointerType
Definition TensorEvalTo.h:74
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvalToOp(PointerType buffer, const XprType &expr)
Definition TensorEvalTo.h:81
Eigen::NumTraits< Scalar >::Real RealScalar
Definition TensorEvalTo.h:72
Eigen::internal::traits< TensorEvalToOp >::Index Index
Definition TensorEvalTo.h:77
static const int NumDims
Definition TensorEvalTo.h:79
PointerType m_buffer
Definition TensorEvalTo.h:92
EIGEN_DEVICE_FUNC PointerType buffer() const
Definition TensorEvalTo.h:88
Eigen::internal::nested< TensorEvalToOp >::type Nested
Definition TensorEvalTo.h:75
Eigen::internal::traits< TensorEvalToOp >::Scalar Scalar
Definition TensorEvalTo.h:71
Definition TensorCostModel.h:25
Definition TensorBlock.h:1381
IndexType offset() const
Definition TensorBlock.h:298
const Dimensions & dimensions() const
Definition TensorBlock.h:299
Definition TensorRef.h:81
@ Unaligned
Definition Constants.h:233
@ Aligned
Definition Constants.h:240
@ kMaterializedInOutput
Definition TensorBlock.h:610
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
Definition BandTriangularSolver.h:13
Container::iterator get(Container &c, Position position)
Definition stdlist_overload.cpp:29
Definition Constants.h:507
Definition TensorForwardDeclarations.h:21
Definition TensorMeta.h:50
Definition TensorForwardDeclarations.h:37
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition TensorEvalTo.h:105
TensorEvaluator< ArgType, Device >::Dimensions Dimensions
Definition TensorEvalTo.h:102
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType scalar)
Definition TensorEvalTo.h:144
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalPacket(Index i)
Definition TensorEvalTo.h:163
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition TensorEvalTo.h:168
TensorEvaluator< constArgType, Device >::TensorBlock ArgTensorBlock
Definition TensorEvalTo.h:127
Storage::Type EvaluatorPointerType
Definition TensorEvalTo.h:109
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalScalar(Index i)
Definition TensorEvalTo.h:160
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalBlock(TensorBlockDesc &desc, TensorBlockScratch &scratch)
Definition TensorEvalTo.h:172
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition TensorEvalTo.h:216
EIGEN_STRONG_INLINE ~TensorEvaluator()
Definition TensorEvalTo.h:138
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition TensorEvalTo.h:198
XprType::Index Index
Definition TensorEvalTo.h:103
ArgType expression() const
Definition TensorEvalTo.h:217
StorageMemory< CoeffReturnType, Device > Storage
Definition TensorEvalTo.h:108
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition TensorEvalTo.h:134
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition TensorEvalTo.h:204
EIGEN_DEVICE_FUNC const Dimensions & dimensions() const
Definition TensorEvalTo.h:142
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition TensorEvalTo.h:124
EIGEN_STRONG_INLINE void cleanup()
Definition TensorEvalTo.h:194
internal::remove_const< typenameXprType::CoeffReturnType >::type CoeffReturnType
Definition TensorEvalTo.h:104
internal::TensorBlockDescriptor< NumDims, Index > TensorBlockDesc
Definition TensorEvalTo.h:123
Eigen::internal::traits< XprType >::PointerType TensorPointerType
Definition TensorEvalTo.h:107
ArgType::Scalar Scalar
Definition TensorEvalTo.h:101
internal::TensorBlockAssignment< CoeffReturnType, NumDims, typename ArgTensorBlock::XprType, Index > TensorBlockAssignment
Definition TensorEvalTo.h:131
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition TensorEvalTo.h:209
TensorEvalToOp< ArgType, MakePointer_ > XprType
Definition TensorEvalTo.h:100
A cost model used to limit the number of threads used for evaluating tensor expression.
Definition TensorEvaluator.h:29
Storage::Type EvaluatorPointerType
Definition TensorEvaluator.h:39
Derived::Scalar CoeffReturnType
Definition TensorEvaluator.h:32
@ BlockAccess
Definition TensorEvaluator.h:48
@ PreferBlockAccess
Definition TensorEvaluator.h:49
@ PacketAccess
Definition TensorEvaluator.h:47
@ Layout
Definition TensorEvaluator.h:50
@ IsAligned
Definition TensorEvaluator.h:46
Derived::Dimensions Dimensions
Definition TensorEvaluator.h:34
static const int PacketSize
Definition TensorEvaluator.h:36
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition TensorEvaluator.h:158
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition TensorEvaluator.h:105
Definition TensorBlock.h:75
const TensorEvalToOp< XprType, MakePointer_ > & type
Definition TensorEvalTo.h:53
Definition XprHelper.h:332
TensorEvalToOp< XprType, MakePointer_ > type
Definition TensorEvalTo.h:59
Definition TensorTraits.h:175
MakePointer_< T > MakePointerT
Definition TensorEvalTo.h:43
MakePointerT::Type Type
Definition TensorEvalTo.h:44
traits< XprType > XprTraits
Definition TensorEvalTo.h:28
XprTraits::StorageKind StorageKind
Definition TensorEvalTo.h:29
XprType::Nested Nested
Definition TensorEvalTo.h:31
XprTraits::Index Index
Definition TensorEvalTo.h:30
remove_reference< Nested >::type _Nested
Definition TensorEvalTo.h:32
MakePointer_< Scalar >::Type PointerType
Definition TensorEvalTo.h:35
XprType::Scalar Scalar
Definition TensorEvalTo.h:27
Definition ForwardDeclarations.h:17