geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | Static Public Member Functions | List of all members
geopm::FrequencyGovernor Class Referenceabstract

#include <FrequencyGovernor.hpp>

Inheritance diagram for geopm::FrequencyGovernor:
Inheritance graph
[legend]

Public Member Functions

 FrequencyGovernor ()=default
 
virtual ~FrequencyGovernor ()=default
 
virtual void init_platform_io (void)=0
 Registers signals and controls with PlatformIO using the default control domain. More...
 
virtual int frequency_domain_type (void) const =0
 Get the domain type of frequency control on the platform. Users of the FrequencyGovernor can use this information to determine the size of the vector to pass to adjust_platform(). More...
 
virtual void set_domain_type (int domain_type)=0
 Set the domain type of frequency control that will be used in adjust_platform(). Must be called before init_platform_io(). More...
 
virtual void adjust_platform (const std::vector< double > &frequency_request)=0
 Write frequency control, may be clamped between min and max frequency if request cannot be satisfied. More...
 
virtual bool do_write_batch (void) const =0
 Returns true if last call to adjust_platform requires writing. More...
 
virtual bool set_frequency_bounds (double freq_min, double freq_max)=0
 Sets min and max package bounds. The defaults before calling this method are the min and max frequency for the platform. More...
 
virtual double get_frequency_min () const =0
 Returns the current min frequency used by the governor. More...
 
virtual double get_frequency_max () const =0
 Returns the current max frequency used by the governor. More...
 
virtual double get_frequency_step () const =0
 Returns the frequency step for the platform. More...
 
virtual int get_clamp_count () const =0
 Returns the number of clamping occurrence count for the platform. More...
 
virtual void validate_policy (double &freq_min, double &freq_max) const =0
 Checks that the minimum and maximum frequency are within range for the platform. If not, they will be clamped at the min and max for the platform. More...
 

Static Public Member Functions

static std::unique_ptr< FrequencyGovernormake_unique (void)
 Returns a unique_ptr to a concrete object constructed using the underlying implementation. More...
 
static std::shared_ptr< FrequencyGovernormake_shared (void)
 Returns a shared_ptr to a concrete object constructed using the underlying implementation. More...
 

Constructor & Destructor Documentation

◆ FrequencyGovernor()

geopm::FrequencyGovernor::FrequencyGovernor ( )
default

◆ ~FrequencyGovernor()

virtual geopm::FrequencyGovernor::~FrequencyGovernor ( )
virtualdefault

Member Function Documentation

◆ adjust_platform()

virtual void geopm::FrequencyGovernor::adjust_platform ( const std::vector< double > &  frequency_request)
pure virtual

Write frequency control, may be clamped between min and max frequency if request cannot be satisfied.

Parameters
[in]frequency_requestDesired per domain frequency.

Implemented in geopm::FrequencyGovernorImp.

◆ do_write_batch()

virtual bool geopm::FrequencyGovernor::do_write_batch ( void  ) const
pure virtual

Returns true if last call to adjust_platform requires writing.

Returns
True if platform adjustments have been made, false otherwise.

Implemented in geopm::FrequencyGovernorImp.

◆ frequency_domain_type()

virtual int geopm::FrequencyGovernor::frequency_domain_type ( void  ) const
pure virtual

Get the domain type of frequency control on the platform. Users of the FrequencyGovernor can use this information to determine the size of the vector to pass to adjust_platform().

Returns
The domain with which frequency will be governed.

Implemented in geopm::FrequencyGovernorImp.

◆ get_clamp_count()

virtual int geopm::FrequencyGovernor::get_clamp_count ( ) const
pure virtual

Returns the number of clamping occurrence count for the platform.

Returns
Clamp occurrence counter

Implemented in geopm::FrequencyGovernorImp.

◆ get_frequency_max()

virtual double geopm::FrequencyGovernor::get_frequency_max ( ) const
pure virtual

Returns the current max frequency used by the governor.

Returns
Maximum frequency.

Implemented in geopm::FrequencyGovernorImp.

◆ get_frequency_min()

virtual double geopm::FrequencyGovernor::get_frequency_min ( ) const
pure virtual

Returns the current min frequency used by the governor.

Returns
Minimum frequency.

Implemented in geopm::FrequencyGovernorImp.

◆ get_frequency_step()

virtual double geopm::FrequencyGovernor::get_frequency_step ( ) const
pure virtual

Returns the frequency step for the platform.

Returns
Step frequency.

Implemented in geopm::FrequencyGovernorImp.

◆ init_platform_io()

virtual void geopm::FrequencyGovernor::init_platform_io ( void  )
pure virtual

Registers signals and controls with PlatformIO using the default control domain.

Implemented in geopm::FrequencyGovernorImp.

◆ make_shared()

std::shared_ptr< FrequencyGovernor > geopm::FrequencyGovernor::make_shared ( void  )
static

Returns a shared_ptr to a concrete object constructed using the underlying implementation.

◆ make_unique()

std::unique_ptr< FrequencyGovernor > geopm::FrequencyGovernor::make_unique ( void  )
static

Returns a unique_ptr to a concrete object constructed using the underlying implementation.

◆ set_domain_type()

virtual void geopm::FrequencyGovernor::set_domain_type ( int  domain_type)
pure virtual

Set the domain type of frequency control that will be used in adjust_platform(). Must be called before init_platform_io().

Exceptions
Exceptionthe requested domain does not contain the frequency control's native domain.
ExceptionThe caller attempted to set the domain type after this governor initialized its PlatformIO controls.

Implemented in geopm::FrequencyGovernorImp.

◆ set_frequency_bounds()

virtual bool geopm::FrequencyGovernor::set_frequency_bounds ( double  freq_min,
double  freq_max 
)
pure virtual

Sets min and max package bounds. The defaults before calling this method are the min and max frequency for the platform.

Parameters
[in]freq_minMinimum frequency value for the control domain.
[in]freq_maxMaximum frequency value for the control domain.
Returns
Returns true if internal state updated, otherwise false.

Implemented in geopm::FrequencyGovernorImp.

◆ validate_policy()

virtual void geopm::FrequencyGovernor::validate_policy ( double &  freq_min,
double &  freq_max 
) const
pure virtual

Checks that the minimum and maximum frequency are within range for the platform. If not, they will be clamped at the min and max for the platform.

Parameters
[in,out]freq_minMinimum frequency to attempt to set, and resulting valid minimum.
[in,out]freq_maxMaximum frequency to attempt to set, and resulting valid maximum.

Implemented in geopm::FrequencyGovernorImp.


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