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...

Public Member Functions

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

Protected Attributes

const DeviceType & m_device
 
DoneCallback m_done
 
ExpressionType & m_expression
 

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;

Definition at line 85 of file TensorDevice.h.

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

Definition at line 87 of file TensorDevice.h.

89  : m_device(device), m_expression(expression), m_done(std::move(done)) {}
const DeviceType & m_device
Definition: TensorDevice.h:104
ExpressionType & m_expression
Definition: TensorDevice.h:105

Member Function Documentation

◆ operator=()

template<typename ExpressionType , typename DeviceType , typename DoneCallback >
template<typename OtherDerived >
TensorAsyncDevice& Eigen::TensorAsyncDevice< ExpressionType, DeviceType, DoneCallback >::operator= ( const OtherDerived &  other)
inline

Definition at line 92 of file TensorDevice.h.

92  {
93  typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
94  typedef internal::TensorExecutor<const Assign, DeviceType> Executor;
95 
96  Assign assign(m_expression, other);
97  Executor::run(assign, m_device);
98  m_done();
99 
100  return *this;
101  }

Member Data Documentation

◆ m_device

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

Definition at line 104 of file TensorDevice.h.

◆ m_done

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

Definition at line 106 of file TensorDevice.h.

◆ m_expression

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

Definition at line 105 of file TensorDevice.h.


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