Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
sw::universal::energy::EnergyEstimator Class Reference

Energy estimator helper class Accumulates energy for a sequence of operations. More...

#include <energy.hpp>

Public Member Functions

 EnergyEstimator (const EnergyCostModel &model=getDefaultModel())
void addOperations (Operation op, BitWidth width, uint64_t count)
 Add energy for N operations of given type and width.
void addMemoryReads (MemoryLevel level, uint64_t bytes)
 Add energy for memory reads at given level.
void addMemoryWrites (MemoryLevel level, uint64_t bytes)
 Add energy for memory writes at given level.
double totalEnergyPJ () const
 Get total accumulated energy in picojoules.
double totalEnergyNJ () const
 Get total accumulated energy in nanojoules.
double totalEnergyUJ () const
 Get total accumulated energy in microjoules.
double totalEnergyMJ () const
 Get total accumulated energy in millijoules.
double totalEnergyJ () const
 Get total accumulated energy in joules.
void reset ()
 Reset accumulator.
const EnergyCostModel & model () const
 Get the model being used.

Detailed Description

Energy estimator helper class Accumulates energy for a sequence of operations.

Constructor & Destructor Documentation

◆ EnergyEstimator()

sw::universal::energy::EnergyEstimator::EnergyEstimator ( const EnergyCostModel & model = getDefaultModel())
inlineexplicit

Member Function Documentation

◆ addMemoryReads()

void sw::universal::energy::EnergyEstimator::addMemoryReads ( MemoryLevel level,
uint64_t bytes )
inline

Add energy for memory reads at given level.

◆ addMemoryWrites()

void sw::universal::energy::EnergyEstimator::addMemoryWrites ( MemoryLevel level,
uint64_t bytes )
inline

Add energy for memory writes at given level.

◆ addOperations()

void sw::universal::energy::EnergyEstimator::addOperations ( Operation op,
BitWidth width,
uint64_t count )
inline

Add energy for N operations of given type and width.

◆ model()

const EnergyCostModel & sw::universal::energy::EnergyEstimator::model ( ) const
inline

Get the model being used.

◆ reset()

void sw::universal::energy::EnergyEstimator::reset ( )
inline

Reset accumulator.

◆ totalEnergyJ()

double sw::universal::energy::EnergyEstimator::totalEnergyJ ( ) const
inline

Get total accumulated energy in joules.

◆ totalEnergyMJ()

double sw::universal::energy::EnergyEstimator::totalEnergyMJ ( ) const
inline

Get total accumulated energy in millijoules.

◆ totalEnergyNJ()

double sw::universal::energy::EnergyEstimator::totalEnergyNJ ( ) const
inline

Get total accumulated energy in nanojoules.

◆ totalEnergyPJ()

double sw::universal::energy::EnergyEstimator::totalEnergyPJ ( ) const
inline

Get total accumulated energy in picojoules.

◆ totalEnergyUJ()

double sw::universal::energy::EnergyEstimator::totalEnergyUJ ( ) const
inline

Get total accumulated energy in microjoules.


The documentation for this class was generated from the following file:
  • /home/runner/work/universal/universal/include/sw/universal/energy/energy.hpp