Eigen::TensorOpCost Class Reference

Public Member Functions

double bytes_loaded () const
 
double bytes_stored () const
 
double compute_cycles () const
 
TensorOpCost cwiseMax (const TensorOpCost &rhs) const
 
TensorOpCost cwiseMin (const TensorOpCost &rhs) const
 
void dropMemoryCost ()
 
TensorOpCostoperator*= (double rhs)
 
TensorOpCostoperator+= (const TensorOpCost &rhs)
 
 TensorOpCost ()
 
 TensorOpCost (double bytes_loaded, double bytes_stored, double compute_cycles)
 
 TensorOpCost (double bytes_loaded, double bytes_stored, double compute_cycles, bool vectorized, double packet_size)
 
double total_cost (double load_cost, double store_cost, double compute_cost) const
 

Static Public Member Functions

template<typename ArgType >
static int AddCost ()
 
template<typename SrcType , typename TargetType >
static int CastCost ()
 
template<typename ArgType >
static int DivCost ()
 
template<typename ArgType >
static int ModCost ()
 
template<typename ArgType >
static int MulCost ()
 

Private Attributes

double bytes_loaded_
 
double bytes_stored_
 
double compute_cycles_
 

Detailed Description

Definition at line 27 of file TensorCostModel.h.

Constructor & Destructor Documentation

◆ TensorOpCost() [1/3]

Eigen::TensorOpCost::TensorOpCost ( )
inline

Definition at line 57 of file TensorCostModel.h.

◆ TensorOpCost() [2/3]

Eigen::TensorOpCost::TensorOpCost ( double  bytes_loaded,
double  bytes_stored,
double  compute_cycles 
)
inline

Definition at line 59 of file TensorCostModel.h.

◆ TensorOpCost() [3/3]

Eigen::TensorOpCost::TensorOpCost ( double  bytes_loaded,
double  bytes_stored,
double  compute_cycles,
bool  vectorized,
double  packet_size 
)
inline

Definition at line 65 of file TensorCostModel.h.

69  compute_cycles_(vectorized ? compute_cycles / packet_size
70  : compute_cycles) {
74  }
#define eigen_assert(x)
EIGEN_ALWAYS_INLINE bool() isfinite(const Eigen::bfloat16 &h)

Member Function Documentation

◆ AddCost()

template<typename ArgType >
static int Eigen::TensorOpCost::AddCost ( )
inlinestatic

Definition at line 38 of file TensorCostModel.h.

38  {
39  return internal::functor_traits<internal::scalar_sum_op<ArgType> >::Cost;
40  }

◆ bytes_loaded()

double Eigen::TensorOpCost::bytes_loaded ( ) const
inline

Definition at line 76 of file TensorCostModel.h.

76  {
77  return bytes_loaded_;
78  }

◆ bytes_stored()

double Eigen::TensorOpCost::bytes_stored ( ) const
inline

Definition at line 79 of file TensorCostModel.h.

79  {
80  return bytes_stored_;
81  }

◆ CastCost()

template<typename SrcType , typename TargetType >
static int Eigen::TensorOpCost::CastCost ( )
inlinestatic

Definition at line 51 of file TensorCostModel.h.

51  {
52  return internal::functor_traits<
53  internal::scalar_cast_op<SrcType, TargetType> >::Cost;
54  }

◆ compute_cycles()

double Eigen::TensorOpCost::compute_cycles ( ) const
inline

Definition at line 82 of file TensorCostModel.h.

82  {
83  return compute_cycles_;
84  }

◆ cwiseMax()

TensorOpCost Eigen::TensorOpCost::cwiseMax ( const TensorOpCost rhs) const
inline

Definition at line 108 of file TensorCostModel.h.

109  {
110  double bytes_loaded = numext::maxi(bytes_loaded_, rhs.bytes_loaded());
111  double bytes_stored = numext::maxi(bytes_stored_, rhs.bytes_stored());
112  double compute_cycles = numext::maxi(compute_cycles_, rhs.compute_cycles());
114  }
EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)

◆ cwiseMin()

TensorOpCost Eigen::TensorOpCost::cwiseMin ( const TensorOpCost rhs) const
inline

Definition at line 99 of file TensorCostModel.h.

100  {
101  double bytes_loaded = numext::mini(bytes_loaded_, rhs.bytes_loaded());
102  double bytes_stored = numext::mini(bytes_stored_, rhs.bytes_stored());
103  double compute_cycles = numext::mini(compute_cycles_, rhs.compute_cycles());
105  }
EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)

◆ DivCost()

template<typename ArgType >
static int Eigen::TensorOpCost::DivCost ( )
inlinestatic

Definition at line 42 of file TensorCostModel.h.

42  {
43  return internal::functor_traits<
44  internal::scalar_quotient_op<ArgType, ArgType> >::Cost;
45  }

◆ dropMemoryCost()

void Eigen::TensorOpCost::dropMemoryCost ( )
inline

Definition at line 93 of file TensorCostModel.h.

93  {
94  bytes_loaded_ = 0;
95  bytes_stored_ = 0;
96  }

◆ ModCost()

template<typename ArgType >
static int Eigen::TensorOpCost::ModCost ( )
inlinestatic

Definition at line 47 of file TensorCostModel.h.

47  {
48  return internal::functor_traits<internal::scalar_mod_op<ArgType> >::Cost;
49  }

◆ MulCost()

template<typename ArgType >
static int Eigen::TensorOpCost::MulCost ( )
inlinestatic

Definition at line 33 of file TensorCostModel.h.

33  {
34  return internal::functor_traits<
35  internal::scalar_product_op<ArgType, ArgType> >::Cost;
36  }

◆ operator*=()

TensorOpCost& Eigen::TensorOpCost::operator*= ( double  rhs)
inline

Definition at line 124 of file TensorCostModel.h.

124  {
125  bytes_loaded_ *= rhs;
126  bytes_stored_ *= rhs;
127  compute_cycles_ *= rhs;
128  return *this;
129  }

◆ operator+=()

TensorOpCost& Eigen::TensorOpCost::operator+= ( const TensorOpCost rhs)
inline

Definition at line 116 of file TensorCostModel.h.

117  {
118  bytes_loaded_ += rhs.bytes_loaded();
119  bytes_stored_ += rhs.bytes_stored();
120  compute_cycles_ += rhs.compute_cycles();
121  return *this;
122  }

◆ total_cost()

double Eigen::TensorOpCost::total_cost ( double  load_cost,
double  store_cost,
double  compute_cost 
) const
inline

Definition at line 85 of file TensorCostModel.h.

86  {
87  return load_cost * bytes_loaded_ + store_cost * bytes_stored_ +
88  compute_cost * compute_cycles_;
89  }

Member Data Documentation

◆ bytes_loaded_

double Eigen::TensorOpCost::bytes_loaded_
private

Definition at line 154 of file TensorCostModel.h.

◆ bytes_stored_

double Eigen::TensorOpCost::bytes_stored_
private

Definition at line 155 of file TensorCostModel.h.

◆ compute_cycles_

double Eigen::TensorOpCost::compute_cycles_
private

Definition at line 156 of file TensorCostModel.h.


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