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::PGOCalibrator Class Reference

Profile-Guided Energy Calibrator Uses RAPL measurements to calibrate energy models. More...

#include <pgo_energy.hpp>

Public Types

using Kernel = std::function<void()>

Public Member Functions

 PGOCalibrator ()
 PGOCalibrator (const energy::EnergyCostModel &model)
CalibrationStats calibrate (const std::string &kernel_name, Kernel kernel, uint64_t ops_per_iteration, energy::Operation op_type, energy::BitWidth bit_width, size_t iterations=100, size_t warmup=10)
 Run calibration for a specific kernel Returns calibration statistics.
template<typename Func>
CalibrationStats calibrateMultiple (const std::string &name, Func &&kernel_factory, const std::vector< energy::BitWidth > &widths, uint64_t ops_per_call, size_t iterations=50)
 Calibrate with multiple precisions/operations.
CalibrationCoefficients learnCoefficients (const CalibrationStats &stats)
 Learn calibration coefficients from measurements.
const energy::EnergyCostModel & model () const
 Get the energy model being used.

Detailed Description

Profile-Guided Energy Calibrator Uses RAPL measurements to calibrate energy models.

Member Typedef Documentation

◆ Kernel

using sw::universal::PGOCalibrator::Kernel = std::function<void()>

Constructor & Destructor Documentation

◆ PGOCalibrator() [1/2]

sw::universal::PGOCalibrator::PGOCalibrator ( )
inline

◆ PGOCalibrator() [2/2]

sw::universal::PGOCalibrator::PGOCalibrator ( const energy::EnergyCostModel & model)
inlineexplicit

Member Function Documentation

◆ calibrate()

CalibrationStats sw::universal::PGOCalibrator::calibrate ( const std::string & kernel_name,
Kernel kernel,
uint64_t ops_per_iteration,
energy::Operation op_type,
energy::BitWidth bit_width,
size_t iterations = 100,
size_t warmup = 10 )
inline

Run calibration for a specific kernel Returns calibration statistics.

◆ calibrateMultiple()

template<typename Func>
CalibrationStats sw::universal::PGOCalibrator::calibrateMultiple ( const std::string & name,
Func && kernel_factory,
const std::vector< energy::BitWidth > & widths,
uint64_t ops_per_call,
size_t iterations = 50 )
inline

Calibrate with multiple precisions/operations.

◆ learnCoefficients()

CalibrationCoefficients sw::universal::PGOCalibrator::learnCoefficients ( const CalibrationStats & stats)
inline

Learn calibration coefficients from measurements.

◆ model()

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

Get the energy model being used.


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