Eigen::TensorDevice< ExpressionType, DeviceType > Class Template Reference

Pseudo expression providing an operator = that will evaluate its argument on the specified computing 'device' (GPU, thread pool, ...) More...

Public Member Functions

template<typename OtherDerived >
TensorDeviceoperator+= (const OtherDerived &other)
 
template<typename OtherDerived >
TensorDeviceoperator-= (const OtherDerived &other)
 
template<typename OtherDerived >
TensorDeviceoperator= (const OtherDerived &other)
 
 TensorDevice (const DeviceType &device, ExpressionType &expression)
 

Protected Attributes

const DeviceType & m_device
 
ExpressionType & m_expression
 

Detailed Description

template<typename ExpressionType, typename DeviceType>
class Eigen::TensorDevice< ExpressionType, DeviceType >

Pseudo expression providing an operator = that will evaluate its argument on the specified computing 'device' (GPU, thread pool, ...)

Example: C.device(EIGEN_GPU) = A + B;

Todo: operator *= and /=.

Definition at line 29 of file TensorDevice.h.

Constructor & Destructor Documentation

◆ TensorDevice()

template<typename ExpressionType , typename DeviceType >
Eigen::TensorDevice< ExpressionType, DeviceType >::TensorDevice ( const DeviceType &  device,
ExpressionType &  expression 
)
inline

Definition at line 31 of file TensorDevice.h.

31 : m_device(device), m_expression(expression) {}
const DeviceType & m_device
Definition: TensorDevice.h:66
ExpressionType & m_expression
Definition: TensorDevice.h:67

Member Function Documentation

◆ operator+=()

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

Definition at line 44 of file TensorDevice.h.

44  {
45  typedef typename OtherDerived::Scalar Scalar;
46  typedef TensorCwiseBinaryOp<internal::scalar_sum_op<Scalar>, const ExpressionType, const OtherDerived> Sum;
47  Sum sum(m_expression, other);
48  typedef TensorAssignOp<ExpressionType, const Sum> Assign;
49  Assign assign(m_expression, sum);
50  internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
51  return *this;
52  }

◆ operator-=()

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

Definition at line 55 of file TensorDevice.h.

55  {
56  typedef typename OtherDerived::Scalar Scalar;
57  typedef TensorCwiseBinaryOp<internal::scalar_difference_op<Scalar>, const ExpressionType, const OtherDerived> Difference;
58  Difference difference(m_expression, other);
59  typedef TensorAssignOp<ExpressionType, const Difference> Assign;
60  Assign assign(m_expression, difference);
61  internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
62  return *this;
63  }

◆ operator=()

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

Definition at line 36 of file TensorDevice.h.

36  {
37  typedef TensorAssignOp<ExpressionType, const OtherDerived> Assign;
38  Assign assign(m_expression, other);
39  internal::TensorExecutor<const Assign, DeviceType>::run(assign, m_device);
40  return *this;
41  }

Member Data Documentation

◆ m_device

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

Definition at line 66 of file TensorDevice.h.

◆ m_expression

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

Definition at line 67 of file TensorDevice.h.


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