10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_EVAL_TO_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_EVAL_TO_H
26 template <
typename XprType,
template <
class>
class MakePointer_>
33 typedef typename XprType::Nested
Nested;
34 typedef std::remove_reference_t<Nested>
Nested_;
35 static constexpr
int NumDimensions = XprTraits::NumDimensions;
36 static constexpr
int Layout = XprTraits::Layout;
48 template <
typename XprType,
template <
class>
class MakePointer_>
53 template <
typename XprType,
template <
class>
class MakePointer_>
60 template <
typename XprType,
template <
class>
class MakePointer_>
85 template <
typename ArgType,
typename Device,
template <
class>
class MakePointer_>
101 PreferBlockAccess =
false,
120 : m_impl(
op.expression(), device), m_buffer(device.
get(
op.buffer())), m_expression(
op.expression()) {}
129 return m_impl.evalSubExprsIfNeeded(m_buffer);
132 #ifdef EIGEN_USE_THREADS
133 template <
typename EvalSubExprsCallback>
137 m_impl.evalSubExprsIfNeededAsync(m_buffer, std::move(done));
143 internal::pstoret<CoeffReturnType, PacketReturnType, Aligned>(
148 return m_impl.getResourceRequirements();
153 desc.template AddDestinationBuffer<Layout>(
155 internal::strides<Layout>(m_impl.dimensions()));
162 TensorBlockAssignment::Run(
163 TensorBlockAssignment::target(desc.
dimensions(), internal::strides<Layout>(m_impl.dimensions()), m_buffer,
174 template <
int LoadMode>
176 return internal::ploadt<PacketReturnType, LoadMode>(m_buffer + index);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_UNUSED_VARIABLE(var)
Definition: Macros.h:966
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
SCALAR Scalar
Definition: bench_gemm.cpp:45
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
Definition: TensorEvalTo.h:61
XprType::Nested m_xpr
Definition: TensorEvalTo.h:81
Eigen::internal::traits< TensorEvalToOp >::StorageKind StorageKind
Definition: TensorEvalTo.h:68
MakePointer_< CoeffReturnType >::Type PointerType
Definition: TensorEvalTo.h:66
EIGEN_DEVICE_FUNC const internal::remove_all_t< typename XprType::Nested > & expression() const
Definition: TensorEvalTo.h:76
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvalToOp(PointerType buffer, const XprType &expr)
Definition: TensorEvalTo.h:73
Eigen::NumTraits< Scalar >::Real RealScalar
Definition: TensorEvalTo.h:64
Eigen::internal::traits< TensorEvalToOp >::Index Index
Definition: TensorEvalTo.h:69
PointerType m_buffer
Definition: TensorEvalTo.h:82
EIGEN_DEVICE_FUNC PointerType buffer() const
Definition: TensorEvalTo.h:78
static constexpr int NumDims
Definition: TensorEvalTo.h:71
Eigen::internal::nested< TensorEvalToOp >::type Nested
Definition: TensorEvalTo.h:67
Eigen::internal::traits< TensorEvalToOp >::Scalar Scalar
Definition: TensorEvalTo.h:63
std::remove_const_t< typename XprType::CoeffReturnType > CoeffReturnType
Definition: TensorEvalTo.h:65
Definition: TensorCostModel.h:28
Definition: TensorBlock.h:1314
IndexType offset() const
Definition: TensorBlock.h:270
const Dimensions & dimensions() const
Definition: TensorBlock.h:271
Definition: TensorBlock.h:475
Definition: TensorBlock.h:604
const XprType & expr() const
Definition: TensorBlock.h:621
TensorBlockKind kind() const
Definition: TensorBlock.h:617
void cleanup()
Definition: TensorBlock.h:626
@ Unaligned
Definition: Constants.h:235
@ Aligned
Definition: Constants.h:242
char char * op
Definition: level2_impl.h:374
@ kMaterializedInOutput
Definition: TensorBlock.h:559
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
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
Definition: Eigen_Colamd.h:49
Type
Type of JSON value.
Definition: rapidjson.h:513
Container::iterator get(Container &c, Position position)
Definition: stdlist_overload.cpp:29
Definition: Constants.h:519
T Real
Definition: NumTraits.h:183
Definition: TensorForwardDeclarations.h:25
Definition: TensorMeta.h:47
Definition: TensorForwardDeclarations.h:42
TensorEvaluator< ArgType, Device >::Dimensions Dimensions
Definition: TensorEvalTo.h:89
TensorEvaluator< ArgType, Device > m_impl
Definition: TensorEvalTo.h:189
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorEvalTo.h:92
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType scalar)
Definition: TensorEvalTo.h:126
TensorEvaluator< const ArgType, Device >::TensorBlock ArgTensorBlock
Definition: TensorEvalTo.h:113
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition: TensorEvalTo.h:147
Storage::Type EvaluatorPointerType
Definition: TensorEvalTo.h:96
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalScalar(Index i) const
Definition: TensorEvalTo.h:141
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalBlock(TensorBlockDesc &desc, TensorBlockScratch &scratch)
Definition: TensorEvalTo.h:151
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvalTo.h:185
EIGEN_STRONG_INLINE ~TensorEvaluator()
Definition: TensorEvalTo.h:122
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorEvalTo.h:172
XprType::Index Index
Definition: TensorEvalTo.h:90
internal::TensorBlockAssignment< CoeffReturnType, NumDims, typename ArgTensorBlock::XprType, Index > TensorBlockAssignment
Definition: TensorEvalTo.h:116
ArgType expression() const
Definition: TensorEvalTo.h:186
const ArgType m_expression
Definition: TensorEvalTo.h:191
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorEvalTo.h:95
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorEvalTo.h:119
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorEvalTo.h:175
EvaluatorPointerType m_buffer
Definition: TensorEvalTo.h:190
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorEvalTo.h:111
EIGEN_DEVICE_FUNC const Dimensions & dimensions() const
Definition: TensorEvalTo.h:124
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorEvalTo.h:170
std::remove_const_t< typename XprType::CoeffReturnType > CoeffReturnType
Definition: TensorEvalTo.h:91
internal::TensorBlockDescriptor< NumDims, Index > TensorBlockDesc
Definition: TensorEvalTo.h:110
Eigen::internal::traits< XprType >::PointerType TensorPointerType
Definition: TensorEvalTo.h:94
ArgType::Scalar Scalar
Definition: TensorEvalTo.h:88
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalPacket(Index i) const
Definition: TensorEvalTo.h:142
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorEvalTo.h:179
TensorEvalToOp< ArgType, MakePointer_ > XprType
Definition: TensorEvalTo.h:87
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 EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition: TensorEvaluator.h:147
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorEvaluator.h:100
Definition: TensorBlock.h:75
const TensorEvalToOp< XprType, MakePointer_ > & type
Definition: TensorEvalTo.h:50
Definition: XprHelper.h:427
TensorEvalToOp< XprType, MakePointer_ > type
Definition: TensorEvalTo.h:55
Definition: TensorTraits.h:152
ref_selector< T >::type type
Definition: TensorTraits.h:153
MakePointer_< T > MakePointerT
Definition: TensorEvalTo.h:43
MakePointerT::Type Type
Definition: TensorEvalTo.h:44
traits< XprType > XprTraits
Definition: TensorEvalTo.h:30
XprTraits::StorageKind StorageKind
Definition: TensorEvalTo.h:31
std::remove_reference_t< Nested > Nested_
Definition: TensorEvalTo.h:34
XprType::Nested Nested
Definition: TensorEvalTo.h:33
XprTraits::Index Index
Definition: TensorEvalTo.h:32
MakePointer_< Scalar >::Type PointerType
Definition: TensorEvalTo.h:37
XprType::Scalar Scalar
Definition: TensorEvalTo.h:29
Definition: ForwardDeclarations.h:21