10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_ASSIGN_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_ASSIGN_H 24 template<
typename LhsXprType,
typename RhsXprType>
27 typedef typename LhsXprType::Scalar Scalar;
31 typedef typename LhsXprType::Nested LhsNested;
32 typedef typename RhsXprType::Nested RhsNested;
43 template<
typename LhsXprType,
typename RhsXprType>
49 template<
typename LhsXprType,
typename RhsXprType>
59 template<
typename LhsXprType,
typename RhsXprType>
65 typedef typename LhsXprType::CoeffReturnType CoeffReturnType;
70 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
TensorAssignOp(LhsXprType& lhs,
const RhsXprType& rhs)
71 : m_lhs_xpr(lhs), m_rhs_xpr(rhs) {}
80 rhsExpression()
const {
return m_rhs_xpr; }
88 template<
typename LeftArgType,
typename RightArgType,
typename Device>
92 typedef typename XprType::Index
Index;
93 typedef typename XprType::Scalar Scalar;
94 typedef typename XprType::CoeffReturnType CoeffReturnType;
106 EIGEN_DEVICE_FUNC
TensorEvaluator(
const XprType& op,
const Device& device) :
108 m_rightImpl(op.rhsExpression(), device)
113 EIGEN_DEVICE_FUNC
const Dimensions& dimensions()
const 118 return m_rightImpl.dimensions();
121 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
bool evalSubExprsIfNeeded(Scalar*) {
122 eigen_assert(dimensions_match(m_leftImpl.dimensions(), m_rightImpl.dimensions()));
123 m_leftImpl.evalSubExprsIfNeeded(NULL);
128 return m_rightImpl.evalSubExprsIfNeeded(m_leftImpl.data());
130 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void cleanup() {
131 m_leftImpl.cleanup();
132 m_rightImpl.cleanup();
135 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void evalScalar(Index i) {
136 m_leftImpl.coeffRef(i) = m_rightImpl.coeff(i);
138 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void evalPacket(Index i) {
141 m_leftImpl.template writePacket<LhsStoreMode>(i, m_rightImpl.template packet<RhsLoadMode>(i));
143 EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index index)
const 145 return m_leftImpl.coeff(index);
147 template<
int LoadMode>
148 EIGEN_DEVICE_FUNC PacketReturnType packet(Index index)
const 150 return m_leftImpl.template packet<LoadMode>(index);
154 costPerCoeff(
bool vectorized)
const {
158 TensorOpCost left = m_leftImpl.costPerCoeff(vectorized);
159 return m_rightImpl.costPerCoeff(vectorized) +
161 numext::maxi(0.0, left.bytes_loaded() -
sizeof(CoeffReturnType)),
162 left.bytes_stored(), left.compute_cycles()) +
163 TensorOpCost(0,
sizeof(CoeffReturnType), 0, vectorized, PacketSize);
171 EIGEN_DEVICE_FUNC CoeffReturnType* data()
const {
return m_leftImpl.data(); }
181 #endif // EIGEN_CXX11_TENSOR_TENSOR_ASSIGN_H EIGEN_DEVICE_FUNC internal::remove_all< typename LhsXprType::Nested >::type & lhsExpression() const
Definition: TensorAssign.h:76
Definition: TensorCostModel.h:25
Definition: XprHelper.h:158
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
A cost model used to limit the number of threads used for evaluating tensor expression.
Definition: TensorEvaluator.h:28
Definition: TensorAssign.h:60
Data pointer has no specific alignment.
Definition: Constants.h:228
const TensorEvaluator< LeftArgType, Device > & left_impl() const
required by sycl in order to extract the accessor
Definition: TensorAssign.h:167
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Definition: Constants.h:235
The tensor base class.
Definition: TensorBase.h:827
Definition: BandTriangularSolver.h:13
const TensorEvaluator< RightArgType, Device > & right_impl() const
required by sycl in order to extract the accessor
Definition: TensorAssign.h:169
Definition: TensorTraits.h:170
The type used to identify a dense storage.
Definition: Constants.h:491
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
Definition: ForwardDeclarations.h:17
Definition: XprHelper.h:312