10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_EVALUATOR_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_EVALUATOR_H
30 template <
typename Derived,
typename Device>
46 static constexpr
int Layout = Derived::Layout;
52 PreferBlockAccess =
false,
72 if (!
NumTraits<std::remove_const_t<Scalar>>::RequireInitialization && dest) {
79 #ifdef EIGEN_USE_THREADS
80 template <
typename EvalSubExprsCallback>
99 template <
int LoadMode>
101 return internal::ploadt<PacketReturnType, LoadMode>(
m_data + index);
109 template <
typename PacketReturnTypeT>
111 std::enable_if_t<internal::unpacket_traits<PacketReturnTypeT>::masked_load_available, PacketReturnTypeT>
113 return internal::ploadu<PacketReturnTypeT>(
m_data + index, umask);
116 template <
int StoreMode>
118 return internal::pstoret<Scalar, PacketReturnType, StoreMode>(
m_data + index,
x);
148 bool =
false)
const {
153 template <
typename TensorBlock>
160 TensorBlockAssign::Run(
174 template <
typename T>
179 #if defined(EIGEN_CUDA_ARCH) && EIGEN_CUDA_ARCH >= 350
182 return __ldg(address);
186 return __ldg(address);
197 template <
typename Derived,
typename Device>
215 static constexpr
int Layout = Derived::Layout;
221 PreferBlockAccess =
false,
239 if (!
NumTraits<std::remove_const_t<Scalar>>::RequireInitialization &&
data) {
246 #ifdef EIGEN_USE_THREADS
247 template <
typename EvalSubExprsCallback>
261 template <
int LoadMode>
263 return internal::ploadt_ro<PacketReturnType, LoadMode>(
m_data + index);
271 template <
typename PacketReturnTypeT>
273 std::enable_if_t<internal::unpacket_traits<PacketReturnTypeT>::masked_load_available, PacketReturnTypeT>
275 return internal::ploadu<PacketReturnTypeT>(
m_data + index, umask);
281 :
m_dims.IndexOfRowMajor(coords);
294 bool =
false)
const {
309 template <
typename NullaryOp,
typename ArgType,
typename Device>
314 : m_functor(
op.functor()), m_argImpl(
op.nestedExpression(), device), m_wrapper() {}
329 #ifdef EIGEN_USE_SYCL
334 PreferBlockAccess =
false,
347 #ifdef EIGEN_USE_THREADS
348 template <
typename EvalSubExprsCallback>
358 template <
int LoadMode>
360 return m_wrapper.template packetOp<PacketReturnType, Index>(m_functor, index);
377 template <
typename UnaryOp,
typename ArgType,
typename Device>
393 :
m_device(device), m_functor(
op.functor()), m_argImpl(
op.nestedExpression(), device) {}
418 m_argImpl.evalSubExprsIfNeeded(NULL);
422 #ifdef EIGEN_USE_THREADS
423 template <
typename EvalSubExprsCallback>
425 m_argImpl.evalSubExprsIfNeededAsync(
nullptr, [done](
bool) { done(
true); });
433 template <
int LoadMode>
435 return m_functor.packetOp(m_argImpl.template packet<LoadMode>(index));
445 return m_argImpl.getResourceRequirements().addCostPerCoeff({0, 0, functor_cost /
PacketSize});
449 bool =
false)
const {
450 return TensorBlock(m_argImpl.block(desc, scratch), m_functor);
463 template <
typename BinaryOp,
typename LeftArgType,
typename RightArgType,
typename Device>
484 m_functor(
op.functor()),
485 m_leftImpl(
op.lhsExpression(), device),
486 m_rightImpl(
op.rhsExpression(), device) {
490 YOU_MADE_A_PROGRAMMING_MISTAKE);
517 return m_leftImpl.dimensions();
521 m_leftImpl.evalSubExprsIfNeeded(NULL);
522 m_rightImpl.evalSubExprsIfNeeded(NULL);
526 #ifdef EIGEN_USE_THREADS
527 template <
typename EvalSubExprsCallback>
530 m_leftImpl.evalSubExprsIfNeededAsync(
531 nullptr, [
this, done](
bool) { m_rightImpl.evalSubExprsIfNeededAsync(
nullptr, [done](
bool) { done(
true); }); });
536 m_leftImpl.cleanup();
537 m_rightImpl.cleanup();
541 return m_functor(m_leftImpl.coeff(index), m_rightImpl.coeff(index));
543 template <
int LoadMode>
545 return m_functor.packetOp(m_leftImpl.template packet<LoadMode>(index),
546 m_rightImpl.template packet<LoadMode>(index));
551 return m_leftImpl.costPerCoeff(vectorized) + m_rightImpl.costPerCoeff(vectorized) +
558 m_rightImpl.getResourceRequirements())
563 bool =
false)
const {
565 return TensorBlock(m_leftImpl.block(desc, scratch), m_rightImpl.block(desc, scratch), m_functor);
579 template <
typename TernaryOp,
typename Arg1Type,
typename Arg2Type,
typename Arg3Type,
typename Device>
598 : m_functor(
op.functor()),
599 m_arg1Impl(
op.arg1Expression(), device),
600 m_arg2Impl(
op.arg2Expression(), device),
601 m_arg3Impl(
op.arg3Expression(), device) {
605 YOU_MADE_A_PROGRAMMING_MISTAKE);
609 STORAGE_KIND_MUST_MATCH)
612 STORAGE_KIND_MUST_MATCH)
615 STORAGE_INDEX_MUST_MATCH)
618 STORAGE_INDEX_MUST_MATCH)
639 return m_arg1Impl.dimensions();
643 m_arg1Impl.evalSubExprsIfNeeded(NULL);
644 m_arg2Impl.evalSubExprsIfNeeded(NULL);
645 m_arg3Impl.evalSubExprsIfNeeded(NULL);
649 m_arg1Impl.cleanup();
650 m_arg2Impl.cleanup();
651 m_arg3Impl.cleanup();
655 return m_functor(m_arg1Impl.coeff(index), m_arg2Impl.coeff(index), m_arg3Impl.coeff(index));
657 template <
int LoadMode>
659 return m_functor.packetOp(m_arg1Impl.template packet<LoadMode>(index), m_arg2Impl.template packet<LoadMode>(index),
660 m_arg3Impl.template packet<LoadMode>(index));
665 return m_arg1Impl.costPerCoeff(vectorized) + m_arg2Impl.costPerCoeff(vectorized) +
680 template <
typename IfArgType,
typename ThenArgType,
typename ElseArgType,
typename Device>
688 static constexpr
bool TernaryPacketAccess =
709 : m_condImpl(
op.ifExpression(), device),
710 m_thenImpl(
op.thenExpression(), device),
711 m_elseImpl(
op.elseExpression(), device) {
714 YOU_MADE_A_PROGRAMMING_MISTAKE);
717 YOU_MADE_A_PROGRAMMING_MISTAKE);
740 struct TensorSelectOpBlockFactory {
741 template <
typename IfArgXprType,
typename ThenArgXprType,
typename ElseArgXprType>
746 template <
typename IfArgXprType,
typename ThenArgXprType,
typename ElseArgXprType>
748 const ThenArgXprType& then_expr,
749 const ElseArgXprType& else_expr)
const {
761 return m_condImpl.dimensions();
765 m_condImpl.evalSubExprsIfNeeded(NULL);
766 m_thenImpl.evalSubExprsIfNeeded(NULL);
767 m_elseImpl.evalSubExprsIfNeeded(NULL);
771 #ifdef EIGEN_USE_THREADS
772 template <
typename EvalSubExprsCallback>
774 m_condImpl.evalSubExprsIfNeeded(
nullptr, [
this, done](
bool) {
775 m_thenImpl.evalSubExprsIfNeeded(
776 nullptr, [
this, done](
bool) { m_elseImpl.evalSubExprsIfNeeded(
nullptr, [done](
bool) { done(
true); }); });
782 m_condImpl.cleanup();
783 m_thenImpl.cleanup();
784 m_elseImpl.cleanup();
788 return m_condImpl.coeff(index) ? m_thenImpl.coeff(index) : m_elseImpl.coeff(index);
791 template <
int LoadMode,
bool UseTernary = TernaryPacketAccess, std::enable_if_t<!UseTernary,
bool> = true>
796 select.
select[
i] = m_condImpl.coeff(index +
i);
798 return internal::pblend(select, m_thenImpl.template packet<LoadMode>(index),
799 m_elseImpl.template packet<LoadMode>(index));
802 template <
int LoadMode,
bool UseTernary = TernaryPacketAccess, std::enable_if_t<UseTernary,
bool> = true>
804 return TernarySelectOp().template packetOp<PacketReturnType>(m_thenImpl.template packet<LoadMode>(index),
805 m_elseImpl.template packet<LoadMode>(index),
806 m_condImpl.template packet<LoadMode>(index));
810 return m_condImpl.costPerCoeff(vectorized) +
811 m_thenImpl.costPerCoeff(vectorized).
cwiseMax(m_elseImpl.costPerCoeff(vectorized));
815 auto then_req = m_thenImpl.getResourceRequirements();
816 auto else_req = m_elseImpl.getResourceRequirements();
819 merged_req.cost_per_coeff = then_req.cost_per_coeff.cwiseMax(else_req.cost_per_coeff);
825 bool =
false)
const {
830 return TensorBlock(m_condImpl.block(desc, scratch), m_thenImpl.block(desc, scratch),
831 m_elseImpl.block(desc, scratch), TensorSelectOpBlockFactory());
836 #ifdef EIGEN_USE_SYCL
839 m_condImpl.bind(cgh);
840 m_thenImpl.bind(cgh);
841 m_elseImpl.bind(cgh);
852 #if defined(EIGEN_USE_SYCL) && defined(SYCL_COMPILER_IS_DPCPP)
853 template <
typename Derived,
typename Device>
854 struct cl::sycl::is_device_copyable<
855 Eigen::TensorEvaluator<Derived, Device>,
856 std::enable_if_t<!std::is_trivially_copyable<Eigen::TensorEvaluator<Derived, Device>>::value>> : std::true_type {};
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_ALWAYS_INLINE
Definition: Macros.h:845
#define EIGEN_UNROLL_LOOP
Definition: Macros.h:1298
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
#define EIGEN_DEVICE_REF
Definition: TensorMacros.h:34
SCALAR Scalar
Definition: bench_gemm.cpp:45
Definition: TensorExpr.h:162
Eigen::internal::traits< TensorCwiseBinaryOp >::Index Index
Definition: TensorExpr.h:171
Eigen::internal::traits< TensorCwiseBinaryOp >::Scalar Scalar
Definition: TensorExpr.h:166
Definition: TensorExpr.h:49
Eigen::internal::traits< TensorCwiseNullaryOp >::Scalar Scalar
Definition: TensorExpr.h:51
Eigen::internal::traits< TensorCwiseNullaryOp >::Index Index
Definition: TensorExpr.h:56
Definition: TensorExpr.h:233
Eigen::internal::traits< TensorCwiseTernaryOp >::Index Index
Definition: TensorExpr.h:240
Eigen::internal::traits< TensorCwiseTernaryOp >::Scalar Scalar
Definition: TensorExpr.h:235
Definition: TensorExpr.h:97
Eigen::internal::traits< TensorCwiseUnaryOp >::Scalar Scalar
Definition: TensorExpr.h:101
Eigen::internal::traits< TensorCwiseUnaryOp >::Index Index
Definition: TensorExpr.h:106
Definition: TensorCostModel.h:28
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost cwiseMax(const TensorOpCost &rhs) const
Definition: TensorCostModel.h:92
Definition: TensorExpr.h:302
Eigen::internal::traits< TensorSelectOp >::Index Index
Definition: TensorExpr.h:310
Eigen::internal::traits< TensorSelectOp >::Scalar Scalar
Definition: TensorExpr.h:304
Definition: TensorBlock.h:1314
Definition: TensorBlock.h:171
IndexType offset() const
Definition: TensorBlock.h:270
TensorBlockDescriptor & DropDestinationBuffer()
Definition: TensorBlock.h:289
const Dimensions & dimensions() const
Definition: TensorBlock.h:271
Definition: TensorBlock.h:566
Definition: TensorBlock.h:475
Definition: TensorBlock.h:796
Definition: TensorBlock.h:767
Definition: TensorBlock.h:604
static EIGEN_STRONG_INLINE TensorMaterializedBlock materialize(const Scalar *data, const DataDimensions &data_dims, TensorBlockDesc &desc, TensorBlockScratch &scratch)
Definition: TensorBlock.h:699
const XprType & expr() const
Definition: TensorBlock.h:621
Definition: TensorBlock.h:861
@ ColMajor
Definition: Constants.h:318
int * m
Definition: level2_cplx_impl.h:294
char char * op
Definition: level2_impl.h:374
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR __half_raw raw_uint16_to_half(numext::uint16_t x)
Definition: Half.h:496
EIGEN_STRONG_INLINE Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
Definition: AltiVec/PacketMath.h:3075
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T loadConstant(const T *address)
Definition: TensorEvaluator.h:175
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool dimensions_match(Dims1 dims1, Dims2 dims2)
Definition: TensorDimensions.h:322
std::array< T, N > array
Definition: EmulateArray.h:231
squared absolute value
Definition: GlobalFunctions.h:87
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
type
Definition: compute_granudrum_aor.py:141
Definition: Eigen_Colamd.h:49
list x
Definition: plotDoE.py:28
Container::iterator get(Container &c, Position position)
Definition: stdlist_overload.cpp:29
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
Definition: TensorMeta.h:47
Definition: TensorForwardDeclarations.h:42
EvaluatorPointerType m_data
Definition: TensorEvaluator.h:302
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:299
internal::TensorBlockDescriptor< NumCoords, Index > TensorBlockDesc
Definition: TensorEvaluator.h:227
const Device EIGEN_DEVICE_REF m_device
Definition: TensorEvaluator.h:304
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC TensorEvaluator(const Derived &m, const Device &device)
Definition: TensorEvaluator.h:233
const Derived XprType
Definition: TensorEvaluator.h:204
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(const array< DenseIndex, NumCoords > &coords) const
Definition: TensorEvaluator.h:278
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorEvaluator.h:285
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorEvaluator.h:254
Derived::Scalar Scalar
Definition: TensorEvaluator.h:200
Storage::Type EvaluatorPointerType
Definition: TensorEvaluator.h:207
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions & dimensions() const
Definition: TensorEvaluator.h:236
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorEvaluator.h:262
Derived::Dimensions Dimensions
Definition: TensorEvaluator.h:203
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorEvaluator.h:202
StorageMemory< const Scalar, Device > Storage
Definition: TensorEvaluator.h:206
internal::traits< Derived >::template MakePointer< const Scalar >::Type TensorPointerType
Definition: TensorEvaluator.h:205
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t< internal::unpacket_traits< PacketReturnTypeT >::masked_load_available, PacketReturnTypeT > partialPacket(Index index, typename internal::unpacket_traits< PacketReturnTypeT >::mask_t umask) const
Definition: TensorEvaluator.h:274
Derived::Index Index
Definition: TensorEvaluator.h:199
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition: TensorEvaluator.h:289
internal::TensorMaterializedBlock< ScalarNoConst, NumCoords, Layout, Index > TensorBlock
Definition: TensorEvaluator.h:230
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType data)
Definition: TensorEvaluator.h:238
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorEvaluator.h:228
Derived::Scalar CoeffReturnType
Definition: TensorEvaluator.h:201
std::remove_const_t< Scalar > ScalarNoConst
Definition: TensorEvaluator.h:209
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:256
Dimensions m_dims
Definition: TensorEvaluator.h:303
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition: TensorEvaluator.h:293
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorEvaluator.h:544
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition: TensorEvaluator.h:555
internal::TensorCwiseBinaryBlock< BinaryOp, LeftTensorBlock, RightTensorBlock > TensorBlock
Definition: TensorEvaluator.h:512
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorEvaluator.h:535
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType)
Definition: TensorEvaluator.h:520
EIGEN_DEVICE_FUNC TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorEvaluator.h:482
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:568
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:540
Storage::Type EvaluatorPointerType
Definition: TensorEvaluator.h:501
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition: TensorEvaluator.h:562
EIGEN_DEVICE_FUNC const Dimensions & dimensions() const
Definition: TensorEvaluator.h:515
TensorEvaluator< LeftArgType, Device >::Dimensions Dimensions
Definition: TensorEvaluator.h:499
const BinaryOp m_functor
Definition: TensorEvaluator.h:572
TensorCwiseBinaryOp< BinaryOp, LeftArgType, RightArgType > XprType
Definition: TensorEvaluator.h:465
const Device EIGEN_DEVICE_REF m_device
Definition: TensorEvaluator.h:571
XprType::Index Index
Definition: TensorEvaluator.h:494
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorEvaluator.h:497
TensorEvaluator< RightArgType, Device > m_rightImpl
Definition: TensorEvaluator.h:574
internal::TensorBlockDescriptor< NumDims, Index > TensorBlockDesc
Definition: TensorEvaluator.h:506
TensorEvaluator< const LeftArgType, Device >::TensorBlock LeftTensorBlock
Definition: TensorEvaluator.h:509
TensorEvaluator< LeftArgType, Device > m_leftImpl
Definition: TensorEvaluator.h:573
TensorEvaluator< const RightArgType, Device >::TensorBlock RightTensorBlock
Definition: TensorEvaluator.h:510
internal::traits< XprType >::Scalar CoeffReturnType
Definition: TensorEvaluator.h:496
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorEvaluator.h:500
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorEvaluator.h:549
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorEvaluator.h:507
XprType::Scalar Scalar
Definition: TensorEvaluator.h:495
EIGEN_DEVICE_FUNC const Dimensions & dimensions() const
Definition: TensorEvaluator.h:343
internal::traits< XprType >::Scalar CoeffReturnType
Definition: TensorEvaluator.h:318
internal::TensorBlockNotImplemented TensorBlock
Definition: TensorEvaluator.h:340
EIGEN_DEVICE_FUNC TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorEvaluator.h:313
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorEvaluator.h:354
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:356
Storage::Type EvaluatorPointerType
Definition: TensorEvaluator.h:323
TensorCwiseNullaryOp< NullaryOp, ArgType > XprType
Definition: TensorEvaluator.h:311
TensorEvaluator< ArgType, Device > m_argImpl
Definition: TensorEvaluator.h:371
TensorEvaluator< ArgType, Device >::Dimensions Dimensions
Definition: TensorEvaluator.h:321
const internal::nullary_wrapper< CoeffReturnType, NullaryOp > m_wrapper
Definition: TensorEvaluator.h:372
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorEvaluator.h:319
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType)
Definition: TensorEvaluator.h:345
XprType::Index Index
Definition: TensorEvaluator.h:316
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorEvaluator.h:322
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorEvaluator.h:363
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorEvaluator.h:359
const NullaryOp m_functor
Definition: TensorEvaluator.h:370
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:367
XprType::Scalar Scalar
Definition: TensorEvaluator.h:317
TensorEvaluator< Arg1Type, Device > m_arg1Impl
Definition: TensorEvaluator.h:673
internal::traits< XprType >::Scalar CoeffReturnType
Definition: TensorEvaluator.h:626
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:654
Storage::Type EvaluatorPointerType
Definition: TensorEvaluator.h:631
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:669
XprType::Scalar Scalar
Definition: TensorEvaluator.h:625
EIGEN_DEVICE_FUNC TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorEvaluator.h:597
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorEvaluator.h:663
const TernaryOp m_functor
Definition: TensorEvaluator.h:672
TensorCwiseTernaryOp< TernaryOp, Arg1Type, Arg2Type, Arg3Type > XprType
Definition: TensorEvaluator.h:581
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType)
Definition: TensorEvaluator.h:642
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorEvaluator.h:630
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorEvaluator.h:648
TensorEvaluator< Arg2Type, Device > m_arg2Impl
Definition: TensorEvaluator.h:674
EIGEN_DEVICE_FUNC const Dimensions & dimensions() const
Definition: TensorEvaluator.h:637
XprType::Index Index
Definition: TensorEvaluator.h:624
TensorEvaluator< Arg1Type, Device >::Dimensions Dimensions
Definition: TensorEvaluator.h:629
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorEvaluator.h:627
internal::TensorBlockNotImplemented TensorBlock
Definition: TensorEvaluator.h:634
TensorEvaluator< Arg3Type, Device > m_arg3Impl
Definition: TensorEvaluator.h:675
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorEvaluator.h:658
TensorEvaluator< ArgType, Device > m_argImpl
Definition: TensorEvaluator.h:458
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:431
TensorEvaluator< const ArgType, Device >::TensorBlock ArgTensorBlock
Definition: TensorEvaluator.h:410
XprType::Index Index
Definition: TensorEvaluator.h:395
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition: TensorEvaluator.h:448
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorEvaluator.h:429
const Device EIGEN_DEVICE_REF m_device
Definition: TensorEvaluator.h:456
internal::TensorBlockDescriptor< NumDims, Index > TensorBlockDesc
Definition: TensorEvaluator.h:407
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorEvaluator.h:408
const UnaryOp m_functor
Definition: TensorEvaluator.h:457
internal::TensorCwiseUnaryBlock< UnaryOp, ArgTensorBlock > TensorBlock
Definition: TensorEvaluator.h:412
XprType::Scalar Scalar
Definition: TensorEvaluator.h:396
internal::traits< XprType >::Scalar CoeffReturnType
Definition: TensorEvaluator.h:398
EIGEN_DEVICE_FUNC TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorEvaluator.h:392
TensorCwiseUnaryOp< UnaryOp, ArgType > XprType
Definition: TensorEvaluator.h:379
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorEvaluator.h:402
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition: TensorEvaluator.h:443
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorEvaluator.h:438
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:453
std::remove_const_t< Scalar > ScalarNoConst
Definition: TensorEvaluator.h:397
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType)
Definition: TensorEvaluator.h:417
Storage::Type EvaluatorPointerType
Definition: TensorEvaluator.h:403
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
Definition: TensorEvaluator.h:434
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorEvaluator.h:399
TensorEvaluator< ArgType, Device >::Dimensions Dimensions
Definition: TensorEvaluator.h:401
EIGEN_DEVICE_FUNC const Dimensions & dimensions() const
Definition: TensorEvaluator.h:415
TensorSelectOp< const IfArgXprType, const ThenArgXprType, const ElseArgXprType > type
Definition: TensorEvaluator.h:743
XprType< IfArgXprType, ThenArgXprType, ElseArgXprType >::type expr(const IfArgXprType &if_expr, const ThenArgXprType &then_expr, const ElseArgXprType &else_expr) const
Definition: TensorEvaluator.h:747
TensorEvaluator< ElseArgType, Device > m_elseImpl
Definition: TensorEvaluator.h:847
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock block(TensorBlockDesc &desc, TensorBlockScratch &scratch, bool=false) const
Definition: TensorEvaluator.h:824
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:787
Storage::Type EvaluatorPointerType
Definition: TensorEvaluator.h:728
XprType::Scalar Scalar
Definition: TensorEvaluator.h:683
XprType::Index Index
Definition: TensorEvaluator.h:722
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorEvaluator.h:809
TensorEvaluator< ThenArgType, Device > m_thenImpl
Definition: TensorEvaluator.h:846
EIGEN_DEVICE_FUNC TensorEvaluator(const XprType &op, const Device &device)
Definition: TensorEvaluator.h:708
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorEvaluator.h:734
TensorEvaluator< const ElseArgType, Device >::TensorBlock ElseArgTensorBlock
Definition: TensorEvaluator.h:738
internal::TensorBlockDescriptor< NumDims, Index > TensorBlockDesc
Definition: TensorEvaluator.h:733
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition: TensorEvaluator.h:814
EIGEN_DEVICE_FUNC PacketReturnType packet(Index index) const
Definition: TensorEvaluator.h:792
EIGEN_DEVICE_FUNC const Dimensions & dimensions() const
Definition: TensorEvaluator.h:759
TensorEvaluator< const IfArgType, Device >::TensorBlock IfArgTensorBlock
Definition: TensorEvaluator.h:736
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorEvaluator.h:727
TensorSelectOp< IfArgType, ThenArgType, ElseArgType > XprType
Definition: TensorEvaluator.h:682
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorEvaluator.h:724
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType)
Definition: TensorEvaluator.h:764
internal::traits< XprType >::Scalar CoeffReturnType
Definition: TensorEvaluator.h:723
TensorEvaluator< IfArgType, Device > m_condImpl
Definition: TensorEvaluator.h:845
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorEvaluator.h:781
internal::TensorTernaryExprBlock< TensorSelectOpBlockFactory, IfArgTensorBlock, ThenArgTensorBlock, ElseArgTensorBlock > TensorBlock
Definition: TensorEvaluator.h:756
TensorEvaluator< IfArgType, Device >::Dimensions Dimensions
Definition: TensorEvaluator.h:726
TensorEvaluator< const ThenArgType, Device >::TensorBlock ThenArgTensorBlock
Definition: TensorEvaluator.h:737
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvaluatorPointerType data() const
Definition: TensorEvaluator.h:834
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
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType dest)
Definition: TensorEvaluator.h:71
Derived::Scalar Scalar
Definition: TensorEvaluator.h:33
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t< internal::unpacket_traits< PacketReturnTypeT >::masked_load_available, PacketReturnTypeT > partialPacket(Index index, typename internal::unpacket_traits< PacketReturnTypeT >::mask_t umask) const
Definition: TensorEvaluator.h:112
const Device EIGEN_DEVICE_REF m_device
Definition: TensorEvaluator.h:170
internal::TensorBlockScratchAllocator< Device > TensorBlockScratch
Definition: TensorEvaluator.h:61
Storage::Type EvaluatorPointerType
Definition: TensorEvaluator.h:41
internal::TensorBlockDescriptor< NumCoords, Index > TensorBlockDesc
Definition: TensorEvaluator.h:60
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType & coeffRef(Index index) const
Definition: TensorEvaluator.h:94
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const Derived &m, const Device &device)
Definition: TensorEvaluator.h:66
@ PacketAccess
Definition: TensorEvaluator.h:50
@ IsAligned
Definition: TensorEvaluator.h:49
Dimensions m_dims
Definition: TensorEvaluator.h:169
static constexpr int PacketSize
Definition: TensorEvaluator.h:38
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:165
Derived::Scalar CoeffReturnType
Definition: TensorEvaluator.h:34
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:89
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorEvaluator.h:87
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType & coeffRef(const array< DenseIndex, NumCoords > &coords) const
Definition: TensorEvaluator.h:130
internal::traits< Derived >::template MakePointer< Scalar >::Type TensorPointerType
Definition: TensorEvaluator.h:39
Derived XprType
Definition: TensorEvaluator.h:37
static constexpr int NumCoords
Definition: TensorEvaluator.h:44
Derived::Index Index
Definition: TensorEvaluator.h:32
internal::TensorMaterializedBlock< ScalarNoConst, NumCoords, Layout, Index > TensorBlock
Definition: TensorEvaluator.h:63
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writePacket(Index index, const PacketReturnType &x) const
Definition: TensorEvaluator.h:117
StorageMemory< Scalar, Device > Storage
Definition: TensorEvaluator.h:40
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const
Definition: TensorEvaluator.h:143
std::remove_const_t< Scalar > ScalarNoConst
Definition: TensorEvaluator.h:57
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorEvaluator.h:35
Derived::Dimensions Dimensions
Definition: TensorEvaluator.h:36
EvaluatorPointerType m_data
Definition: TensorEvaluator.h:168
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock(const TensorBlockDesc &desc, const TensorBlock &block)
Definition: TensorEvaluator.h:154
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(const array< DenseIndex, NumCoords > &coords) const
Definition: TensorEvaluator.h:121
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
Definition: TensorEvaluator.h:139
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions & dimensions() const
Definition: TensorEvaluator.h:69
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
numext::uint16_t x
Definition: Half.h:101
Definition: GenericPacketMath.h:1421
bool select[N]
Definition: GenericPacketMath.h:1422
Definition: TensorBlock.h:75
EIGEN_DEVICE_FUNC TensorBlockResourceRequirements & addCostPerCoeff(TensorOpCost cost)
Definition: TensorBlock.h:135
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockResourceRequirements any()
Definition: TensorBlock.h:143
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockResourceRequirements merge(const TensorBlockResourceRequirements &lhs, const TensorBlockResourceRequirements &rhs)
Definition: TensorBlock.h:129
Definition: XprHelper.h:205
Definition: TernaryFunctors.h:23
Definition: ForwardDeclarations.h:21
Definition: GenericPacketMath.h:134