27template <
typename ExpressionType,
typename DeviceType>
class TensorDevice {
29 TensorDevice(
const DeviceType& device, ExpressionType& expression) : m_device(device), m_expression(expression) {}
33 template<
typename OtherDerived>
34 EIGEN_STRONG_INLINE
TensorDevice& operator=(
const OtherDerived& other) {
35 typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
36 Assign assign(m_expression, other);
37 internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
41 template<
typename OtherDerived>
42 EIGEN_STRONG_INLINE
TensorDevice& operator+=(
const OtherDerived& other) {
43 typedef typename OtherDerived::Scalar Scalar;
44 typedef TensorCwiseBinaryOp<internal::scalar_sum_op<Scalar>,
const ExpressionType,
const OtherDerived> Sum;
45 Sum sum(m_expression, other);
46 typedef TensorAssignOp<ExpressionType, const Sum> Assign;
47 Assign assign(m_expression, sum);
48 internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
52 template<
typename OtherDerived>
53 EIGEN_STRONG_INLINE
TensorDevice& operator-=(
const OtherDerived& other) {
54 typedef typename OtherDerived::Scalar Scalar;
55 typedef TensorCwiseBinaryOp<internal::scalar_difference_op<Scalar>,
const ExpressionType,
const OtherDerived> Difference;
56 Difference difference(m_expression, other);
57 typedef TensorAssignOp<ExpressionType, const Difference> Assign;
58 Assign assign(m_expression, difference);
59 internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
64 const DeviceType& m_device;
65 ExpressionType& m_expression;
87 : m_device(device), m_expression(expression), m_done(std::move(done)) {}
89 template <
typename OtherDerived>
91 typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
92 typedef internal::TensorExecutor<const Assign, DeviceType> Executor;
94 Assign assign(m_expression, other);
95 Executor::run(assign, m_device);
102 const DeviceType& m_device;
103 ExpressionType& m_expression;