Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback > Class Template Reference

Pseudo expression providing an operator = that will evaluate its argument asynchronously on the specified device. Currently only ThreadPoolDevice implements proper asynchronous execution, while the default and GPU devices just run the expression synchronously and call m_done() on completion.. More...

#include <TensorDevice.h>

Public Member Functions

 TensorAsyncDevice (const DeviceType &device, ExpressionType &expression, DoneCallback done)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE TensorAsyncDeviceoperator= (const OtherDerived &other)
 

Protected Attributes

const DeviceType & m_device
 
ExpressionType & m_expression
 
DoneCallback m_done
 

Detailed Description

template<typename ExpressionType, typename DeviceType, typename DoneCallback>
class Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback >

Pseudo expression providing an operator = that will evaluate its argument asynchronously on the specified device. Currently only ThreadPoolDevice implements proper asynchronous execution, while the default and GPU devices just run the expression synchronously and call m_done() on completion..

Example: auto done = []() { ... expression evaluation done ... }; C.device(thread_pool_device, std::move(done)) = A + B;

Constructor & Destructor Documentation

◆ TensorAsyncDevice()

template<typename ExpressionType , typename DeviceType , typename DoneCallback >
Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback >::TensorAsyncDevice ( const DeviceType &  device,
ExpressionType &  expression,
DoneCallback  done 
)
inline
91  : m_device(device), m_expression(expression), m_done(std::move(done)) {}
const DeviceType & m_device
Definition: TensorDevice.h:106
ExpressionType & m_expression
Definition: TensorDevice.h:107
DoneCallback m_done
Definition: TensorDevice.h:108

Member Function Documentation

◆ operator=()

template<typename ExpressionType , typename DeviceType , typename DoneCallback >
template<typename OtherDerived >
EIGEN_STRONG_INLINE TensorAsyncDevice& Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback >::operator= ( const OtherDerived &  other)
inline
94  {
95  typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
96  typedef internal::TensorExecutor<const Assign, DeviceType> Executor;
97 
98  Assign assign(m_expression, other);
99  Executor::run(assign, m_device);
100  m_done();
101 
102  return *this;
103  }
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

References Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback >::m_device, Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback >::m_done, Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback >::m_expression, and run().

Member Data Documentation

◆ m_device

template<typename ExpressionType , typename DeviceType , typename DoneCallback >
const DeviceType& Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback >::m_device
protected

◆ m_done

template<typename ExpressionType , typename DeviceType , typename DoneCallback >
DoneCallback Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback >::m_done
protected

◆ m_expression

template<typename ExpressionType , typename DeviceType , typename DoneCallback >
ExpressionType& Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback >::m_expression
protected

The documentation for this class was generated from the following file: