10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_EVAL_TO_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_EVAL_TO_H 23 template<
typename XprType,
template <
class>
class MakePointer_>
31 typedef typename XprType::Nested
Nested;
33 static const int NumDimensions = XprTraits::NumDimensions;
34 static const int Layout = XprTraits::Layout;
50 template<
typename XprType,
template <
class>
class MakePointer_>
56 template<
typename XprType,
template <
class>
class MakePointer_>
67 template<
typename XprType,
template <
class>
class MakePointer_>
82 : m_xpr(expr), m_buffer(buffer) {}
97 template<
typename ArgType,
typename Device,
template <
class>
class MakePointer_>
114 PreferBlockAccess =
false,
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>
153 EvaluatorPointerType
scalar, EvalSubExprsCallback done) {
156 m_impl.evalSubExprsIfNeededAsync(m_buffer, std::move(done));
161 m_buffer[
i] = m_impl.coeff(i);
164 internal::pstoret<CoeffReturnType, PacketReturnType, Aligned>(m_buffer +
i, m_impl.template packet<TensorEvaluator<ArgType, Device>::IsAligned ?
Aligned :
Unaligned>(
i));
169 return m_impl.getResourceRequirements();
173 TensorBlockDesc& desc, TensorBlockScratch& scratch) {
175 desc.template AddDestinationBuffer<Layout>(
177 internal::strides<Layout>(m_impl.dimensions()));
180 m_impl.block(desc, scratch,
true);
187 desc.
dimensions(), internal::strides<Layout>(m_impl.dimensions()),
200 return m_buffer[index];
203 template<
int LoadMode>
206 return internal::ploadt<PacketReturnType, LoadMode>(m_buffer + index);
212 return m_impl.costPerCoeff(vectorized) +
213 TensorOpCost(0,
sizeof(CoeffReturnType), 0, vectorized, PacketSize);
218 #ifdef EIGEN_USE_SYCL 236 #endif // EIGEN_CXX11_TENSOR_TENSOR_EVAL_TO_H traits< XprType > XprTraits
StorageMemory< CoeffReturnType, Device > Storage
EIGEN_STRONG_INLINE TensorEvaluator(const XprType &op, const Device &device)
#define EIGEN_STRONG_INLINE
ArgType expression() const
m m block(1, 0, 2, 2)<< 4
const XprType & expr() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
EIGEN_DEVICE_FUNC const internal::remove_all< typename XprType::Nested >::type & expression() const
EvaluatorPointerType m_buffer
TensorEvaluator< ArgType, Device >::Dimensions Dimensions
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalPacket(Index i)
Namespace containing all symbols from the Eigen library.
A cost model used to limit the number of threads used for evaluating tensor expression.
Eigen::internal::traits< XprType >::PointerType TensorPointerType
XprTraits::StorageKind StorageKind
TensorEvaluator< ArgType, Device > m_impl
EIGEN_DEVICE_FUNC PointerType buffer() const
PacketType< CoeffReturnType, Device >::type PacketReturnType
Eigen::internal::traits< TensorEvalToOp >::Scalar Scalar
MakePointer_< Scalar >::Type PointerType
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Run(const Target &target, const TensorBlockExpr &expr)
Storage::Type EvaluatorPointerType
Generic expression where a coefficient-wise binary operator is applied to two expressions.
TensorEvalToOp< XprType, MakePointer_ > type
Eigen::internal::nested< TensorEvalToOp >::type Nested
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvalToOp(PointerType buffer, const XprType &expr)
Eigen::internal::traits< TensorEvalToOp >::Index Index
EIGEN_STRONG_INLINE ~TensorEvaluator()
TensorBlockKind kind() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
static Target target(const Dimensions &target_dims, const Dimensions &target_strides, Scalar *target_data, IndexType target_offset=0)
const TensorEvalToOp< XprType, MakePointer_ > & type
MakePointer_< CoeffReturnType >::Type PointerType
internal::TensorBlockAssignment< CoeffReturnType, NumDims, typename ArgTensorBlock::XprType, Index > TensorBlockAssignment
EIGEN_STRONG_INLINE void cleanup()
TensorEvalToOp< ArgType, MakePointer_ > XprType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
EIGEN_DEVICE_FUNC const Dimensions & dimensions() const
#define EIGEN_DEVICE_FUNC
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
remove_reference< Nested >::type _Nested
internal::remove_const< typename XprType::CoeffReturnType >::type CoeffReturnType
CwiseBinaryOp< internal::scalar_sum_op< double, double >, const CpyMatrixXd, const CpyMatrixXd > XprType
const Dimensions & dimensions() const
Eigen::internal::traits< TensorEvalToOp >::StorageKind StorageKind
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalBlock(TensorBlockDesc &desc, TensorBlockScratch &scratch)
Eigen::NumTraits< Scalar >::Real RealScalar
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType scalar)
const ArgType m_expression
TensorEvaluator< const ArgType, Device >::TensorBlock ArgTensorBlock
Generic expression where a coefficient-wise unary operator is applied to an expression.
Container::iterator get(Container &c, Position position)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalScalar(Index i)
mxArray * scalar(mxClassID classid)
internal::remove_const< typename XprType::CoeffReturnType >::type CoeffReturnType
MakePointer_< T > MakePointerT
#define EIGEN_UNUSED_VARIABLE(var)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
internal::TensorBlockDescriptor< NumDims, Index > TensorBlockDesc
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch