10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_DEVICE_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_DEVICE_H 14 #include "./InternalHeaderCheck.h" 29 template <
typename ExpressionType,
typename DeviceType>
32 TensorDevice(
const DeviceType& device, ExpressionType& expression) : m_device(device), m_expression(expression) {}
36 template <
typename OtherDerived>
37 EIGEN_STRONG_INLINE
TensorDevice& operator=(
const OtherDerived& other) {
39 Assign assign(m_expression, other);
44 template <
typename OtherDerived>
45 EIGEN_STRONG_INLINE
TensorDevice& operator+=(
const OtherDerived& other) {
46 typedef typename OtherDerived::Scalar Scalar;
48 Sum sum(m_expression, other);
50 Assign assign(m_expression, sum);
55 template <
typename OtherDerived>
56 EIGEN_STRONG_INLINE
TensorDevice& operator-=(
const OtherDerived& other) {
57 typedef typename OtherDerived::Scalar Scalar;
60 Difference difference(m_expression, other);
62 Assign assign(m_expression, difference);
68 const DeviceType& m_device;
69 ExpressionType& m_expression;
86 template <
typename ExpressionType,
typename DeviceType,
typename DoneCallback>
89 TensorAsyncDevice(
const DeviceType& device, ExpressionType& expression, DoneCallback done)
90 : m_device(device), m_expression(expression), m_done(std::move(done)) {}
92 template <
typename OtherDerived>
97 Assign assign(m_expression, other);
98 Executor::run(assign, m_device);
105 const DeviceType& m_device;
106 ExpressionType& m_expression;
110 #ifdef EIGEN_USE_THREADS 111 template <
typename ExpressionType,
typename DoneCallback>
114 TensorAsyncDevice(
const ThreadPoolDevice& device, ExpressionType& expression, DoneCallback done)
115 : m_device(device), m_expression(expression), m_done(
std::move(done)) {}
117 template <
typename OtherDerived>
118 EIGEN_STRONG_INLINE TensorAsyncDevice& operator=(
const OtherDerived& other) {
119 typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
120 typedef internal::TensorAsyncExecutor<const Assign, ThreadPoolDevice, DoneCallback> Executor;
123 Assign assign(m_expression, other);
124 Executor::runAsync(assign, m_device, std::move(m_done));
130 const ThreadPoolDevice& m_device;
131 ExpressionType& m_expression;
138 #endif // EIGEN_CXX11_TENSOR_TENSOR_DEVICE_H The tensor executor class.
Definition: TensorExecutor.h:76
Tensor binary expression.
Definition: TensorExpr.h:170
Namespace containing all symbols from the Eigen library.
Pseudo expression providing an operator = that will evaluate its argument on the specified computing ...
Definition: TensorDevice.h:30
Definition: AutoDiffScalar.h:629
Definition: TensorAssign.h:55
Pseudo expression providing an operator = that will evaluate its argument asynchronously on the speci...
Definition: TensorDevice.h:87