10 #ifndef EIGEN_DEVICEWRAPPER_H
11 #define EIGEN_DEVICEWRAPPER_H
14 template <
typename Derived,
typename Device>
22 template <
typename OtherDerived>
28 template <
typename OtherDerived>
34 template <
typename OtherDerived>
54 template <
typename DstXprType,
typename SrcXprType,
typename Functor,
typename Device,
55 typename Kind =
typename AssignmentKind<typename evaluator_traits<DstXprType>::Shape,
57 typename EnableIf =
void>
61 template <
typename DstXprType,
typename Lhs,
typename Rhs,
int Options,
typename Functor,
typename Device,
73 template <
typename DstXprType,
typename SrcXprType,
typename Functor,
typename Device,
typename Weak>
77 #ifndef EIGEN_NO_DEBUG
86 template <
typename Kernel,
typename Device,
int Traversal = Kernel::AssignmentTraits::Traversal,
87 int Unrolling = Kernel::AssignmentTraits::Unrolling>
94 template <
typename Dst,
typename Src,
typename Func,
typename Device>
96 const Src& src,
const Func&
func) {
98 NeedToTranspose = ((
int(Dst::RowsAtCompileTime) == 1 &&
int(Src::ColsAtCompileTime) == 1) ||
99 (
int(Dst::ColsAtCompileTime) == 1 &&
int(Src::RowsAtCompileTime) == 1)) &&
100 int(Dst::SizeAtCompileTime) != 1
103 using ActualDstTypeCleaned = std::conditional_t<NeedToTranspose, Transpose<Dst>, Dst>;
104 using ActualDstType = std::conditional_t<NeedToTranspose, Transpose<Dst>, Dst&>;
105 ActualDstType actualDst(dst.
derived());
113 AssignmentWithDevice<ActualDstTypeCleaned, Src, Func, Device>::
run(actualDst, src,
func, dst.device());
117 template <typename DstXprType, typename SrcXprType, typename
Functor, typename Device>
119 const SrcXprType& src,
125 SrcEvaluatorType srcEvaluator(src);
131 DstEvaluatorType dstEvaluator(dst);
135 Kernel kernel(dstEvaluator, srcEvaluator,
func, dst.const_cast_derived());
142 template <
typename Derived>
143 template <
typename Device>
148 template <
typename Derived>
149 template <
typename Device>
151 Device& device)
const {
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
Definition: StaticAssert.h:87
#define EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(TYPE0, TYPE1)
Definition: StaticAssert.h:79
#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP, LHS, RHS)
Definition: XprHelper.h:1082
SCALAR Scalar
Definition: bench_gemm.cpp:45
Pseudo expression providing an operator = assuming no aliasing.
Definition: NoAlias.h:34
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:202
Definition: AssignEvaluator.h:585
@ Lhs
Definition: TensorContractionMapper.h:20
@ Rhs
Definition: TensorContractionMapper.h:20
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize_if_allowed(DstXprType &dst, const SrcXprType &src, const Functor &)
Definition: AssignEvaluator.h:703
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
Definition: AssignEvaluator.h:781
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
Definition: AssignEvaluator.h:812
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_dense_assignment_loop(DstXprType &dst, const SrcXprType &src, const Functor &func)
Definition: AssignEvaluator.h:720
EIGEN_DEVICE_FUNC void check_for_aliasing(const Dst &dst, const Src &src)
Definition: Transpose.h:416
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
auto run(Kernel kernel, Args &&... args) -> decltype(kernel(args...))
Definition: gpu_test_helper.h:414
Definition: Eigen_Colamd.h:49
Definition: DeviceWrapper.h:15
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Device & device()
Definition: DeviceWrapper.h:42
typename Derived::Scalar Scalar
Definition: DeviceWrapper.h:17
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator-=(const EigenBase< OtherDerived > &other)
Definition: DeviceWrapper.h:35
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE NoAlias< DeviceWrapper, EigenBase > noalias()
Definition: DeviceWrapper.h:43
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & derived()
Definition: DeviceWrapper.h:41
Device & m_device
Definition: DeviceWrapper.h:48
EIGEN_DEVICE_FUNC DeviceWrapper(Base &xpr, Device &device)
Definition: DeviceWrapper.h:19
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const EigenBase< OtherDerived > &other)
Definition: DeviceWrapper.h:23
EIGEN_DEVICE_FUNC DeviceWrapper(const Base &xpr, Device &device)
Definition: DeviceWrapper.h:20
Derived & m_xpr
Definition: DeviceWrapper.h:47
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator+=(const EigenBase< OtherDerived > &other)
Definition: DeviceWrapper.h:29
Definition: EigenBase.h:33
constexpr EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:49
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< Derived, Device > device(Device &device)
Definition: DeviceWrapper.h:144
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const Functor &func, Device &)
Definition: DeviceWrapper.h:66
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const Functor &func, Device &device)
Definition: DeviceWrapper.h:75
Definition: DeviceWrapper.h:58
Definition: AssignEvaluator.h:773
Definition: AssignEvaluator.h:756
Template functor for scalar/packet assignment with addition.
Definition: AssignmentFunctors.h:52
Template functor for scalar/packet assignment.
Definition: AssignmentFunctors.h:25
Definition: DeviceWrapper.h:88
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel, Device &)
Definition: DeviceWrapper.h:90
Definition: AssignEvaluator.h:302
storage_kind_to_shape< typename traits< T >::StorageKind >::Shape Shape
Definition: CoreEvaluators.h:90
Definition: CoreEvaluators.h:104
Template functor for scalar/packet assignment with subtraction.
Definition: AssignmentFunctors.h:73
Definition: NonLinearOptimization.cpp:97
Definition: benchGeometry.cpp:21
void run(const string &dir_name, LinearSolver *linear_solver_pt, const unsigned nel_1d, bool mess_up_order)
Definition: two_d_poisson_compare_solvers.cc:317