10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_DEVICE_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_DEVICE_H 27 template <
typename ExpressionType,
typename DeviceType>
class TensorDevice {
29 TensorDevice(
const DeviceType& device, ExpressionType& expression) : m_device(device), m_expression(expression) {}
31 template<
typename OtherDerived>
32 EIGEN_STRONG_INLINE
TensorDevice& operator=(
const OtherDerived& other) {
33 typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
34 Assign assign(m_expression, other);
35 internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
39 template<
typename OtherDerived>
40 EIGEN_STRONG_INLINE
TensorDevice& operator+=(
const OtherDerived& other) {
41 typedef typename OtherDerived::Scalar Scalar;
42 typedef TensorCwiseBinaryOp<internal::scalar_sum_op<Scalar>,
const ExpressionType,
const OtherDerived> Sum;
43 Sum sum(m_expression, other);
44 typedef TensorAssignOp<ExpressionType, const Sum> Assign;
45 Assign assign(m_expression, sum);
46 internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
50 template<
typename OtherDerived>
51 EIGEN_STRONG_INLINE
TensorDevice& operator-=(
const OtherDerived& other) {
52 typedef typename OtherDerived::Scalar Scalar;
53 typedef TensorCwiseBinaryOp<internal::scalar_difference_op<Scalar>,
const ExpressionType,
const OtherDerived> Difference;
54 Difference difference(m_expression, other);
55 typedef TensorAssignOp<ExpressionType, const Difference> Assign;
56 Assign assign(m_expression, difference);
57 internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
62 const DeviceType& m_device;
63 ExpressionType& m_expression;
68 #endif // EIGEN_CXX11_TENSOR_TENSOR_DEVICE_H Namespace containing all symbols from the Eigen library.
Definition: AdolcForward:45
Pseudo expression providing an operator = that will evaluate its argument on the specified computing ...
Definition: TensorDevice.h:27