10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_COST_MODEL_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_COST_MODEL_H
33 template <
typename ArgType>
37 template <
typename ArgType>
41 template <
typename ArgType>
45 template <
typename ArgType>
49 template <
typename SrcType,
typename TargetType>
72 double compute_cost)
const {
140 template <
typename Device>
156 double cost =
totalCost(output_size, cost_per_coeff);
160 return numext::mini(max_threads, numext::maxi<int>(1,
static_cast<int>(threads)));
181 const double kLoadCycles = 1.0 / 64 * 11;
182 const double kStoreCycles = 1.0 / 64 * 11;
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
Definition: TensorCostModel.h:141
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int numThreads(double output_size, const TensorOpCost &cost_per_coeff, int max_threads)
Definition: TensorCostModel.h:154
static const int kDeviceCyclesPerComputeCycle
Definition: TensorCostModel.h:144
static const int kPerThreadCycles
Definition: TensorCostModel.h:148
static const int kStartupCycles
Definition: TensorCostModel.h:147
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double taskSize(double output_size, const TensorOpCost &cost_per_coeff)
Definition: TensorCostModel.h:166
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double totalCost(double output_size, const TensorOpCost &cost_per_coeff)
Definition: TensorCostModel.h:170
static const int kTaskSize
Definition: TensorCostModel.h:149
Definition: TensorCostModel.h:28
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost cwiseMin(const TensorOpCost &rhs) const
Definition: TensorCostModel.h:84
EIGEN_DEVICE_FUNC TensorOpCost(double bytes_loaded, double bytes_stored, double compute_cycles)
Definition: TensorCostModel.h:55
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost & operator+=(const TensorOpCost &rhs)
Definition: TensorCostModel.h:99
double bytes_loaded_
Definition: TensorCostModel.h:132
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost & operator*=(double rhs)
Definition: TensorCostModel.h:106
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost cwiseMax(const TensorOpCost &rhs) const
Definition: TensorCostModel.h:92
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE friend TensorOpCost operator+(TensorOpCost lhs, const TensorOpCost &rhs)
Definition: TensorCostModel.h:113
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double bytes_stored() const
Definition: TensorCostModel.h:69
double bytes_stored_
Definition: TensorCostModel.h:133
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE friend TensorOpCost operator*(double lhs, TensorOpCost rhs)
Definition: TensorCostModel.h:121
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int MulCost()
Definition: TensorCostModel.h:34
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int ModCost()
Definition: TensorCostModel.h:46
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int AddCost()
Definition: TensorCostModel.h:38
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE friend TensorOpCost operator*(TensorOpCost lhs, double rhs)
Definition: TensorCostModel.h:117
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int CastCost()
Definition: TensorCostModel.h:50
EIGEN_DEVICE_FUNC TensorOpCost()
Definition: TensorCostModel.h:54
friend std::ostream & operator<<(std::ostream &os, const TensorOpCost &tc)
Definition: TensorCostModel.h:126
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double bytes_loaded() const
Definition: TensorCostModel.h:68
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int DivCost()
Definition: TensorCostModel.h:42
double compute_cycles_
Definition: TensorCostModel.h:134
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double compute_cycles() const
Definition: TensorCostModel.h:70
EIGEN_DEVICE_FUNC TensorOpCost(double bytes_loaded, double bytes_stored, double compute_cycles, bool vectorized, double packet_size)
Definition: TensorCostModel.h:58
EIGEN_DEVICE_FUNC void dropMemoryCost()
Definition: TensorCostModel.h:78
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE double total_cost(double load_cost, double store_cost, double compute_cost) const
Definition: TensorCostModel.h:71
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isfinite(const Eigen::bfloat16 &h)
Definition: BFloat16.h:752
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
Definition: MathFunctions.h:926
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition: MathFunctions.h:920
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
Definition: NumTraits.h:172
Definition: XprHelper.h:205