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

#include <FrequencyGovernorImp.hpp>

Inheritance diagram for geopm::FrequencyGovernorImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::FrequencyGovernorImp:
Collaboration graph
[legend]

Public Member Functions

 FrequencyGovernorImp ()
 
 FrequencyGovernorImp (PlatformIO &platform_io, const PlatformTopo &platform_topo)
 
virtual ~FrequencyGovernorImp ()
 
void init_platform_io (void) override
 Registers signals and controls with PlatformIO using the default control domain. More...
 
int frequency_domain_type (void) const override
 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...
 
void set_domain_type (int domain_type) override
 Set the domain type of frequency control that will be used in adjust_platform(). Must be called before init_platform_io(). More...
 
void adjust_platform (const std::vector< double > &frequency_request) override
 Write frequency control, may be clamped between min and max frequency if request cannot be satisfied. More...
 
bool do_write_batch (void) const override
 Returns true if last call to adjust_platform requires writing. More...
 
bool set_frequency_bounds (double freq_min, double freq_max) override
 Sets min and max package bounds. The defaults before calling this method are the min and max frequency for the platform. More...
 
double get_frequency_min () const override
 Returns the current min frequency used by the governor. More...
 
double get_frequency_max () const override
 Returns the current max frequency used by the governor. More...
 
double get_frequency_step () const override
 Returns the frequency step for the platform. More...
 
int get_clamp_count () const override
 Returns the number of clamping occurrence count for the platform. More...
 
void validate_policy (double &freq_min, double &freq_max) const override
 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...
 
- Public Member Functions inherited from geopm::FrequencyGovernor
 FrequencyGovernor ()=default
 
virtual ~FrequencyGovernor ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::FrequencyGovernor
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

◆ FrequencyGovernorImp() [1/2]

geopm::FrequencyGovernorImp::FrequencyGovernorImp ( )

◆ FrequencyGovernorImp() [2/2]

geopm::FrequencyGovernorImp::FrequencyGovernorImp ( PlatformIO &  platform_io,
const PlatformTopo &  platform_topo 
)

◆ ~FrequencyGovernorImp()

geopm::FrequencyGovernorImp::~FrequencyGovernorImp ( )
virtual

Member Function Documentation

◆ adjust_platform()

void geopm::FrequencyGovernorImp::adjust_platform ( const std::vector< double > &  frequency_request)
overridevirtual

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

Parameters
[in]frequency_requestDesired per domain frequency.

Implements geopm::FrequencyGovernor.

◆ do_write_batch()

bool geopm::FrequencyGovernorImp::do_write_batch ( void  ) const
overridevirtual

Returns true if last call to adjust_platform requires writing.

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

Implements geopm::FrequencyGovernor.

◆ frequency_domain_type()

int geopm::FrequencyGovernorImp::frequency_domain_type ( void  ) const
overridevirtual

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.

Implements geopm::FrequencyGovernor.

◆ get_clamp_count()

int geopm::FrequencyGovernorImp::get_clamp_count ( ) const
overridevirtual

Returns the number of clamping occurrence count for the platform.

Returns
Clamp occurrence counter

Implements geopm::FrequencyGovernor.

◆ get_frequency_max()

double geopm::FrequencyGovernorImp::get_frequency_max ( ) const
overridevirtual

Returns the current max frequency used by the governor.

Returns
Maximum frequency.

Implements geopm::FrequencyGovernor.

◆ get_frequency_min()

double geopm::FrequencyGovernorImp::get_frequency_min ( ) const
overridevirtual

Returns the current min frequency used by the governor.

Returns
Minimum frequency.

Implements geopm::FrequencyGovernor.

◆ get_frequency_step()

double geopm::FrequencyGovernorImp::get_frequency_step ( ) const
overridevirtual

Returns the frequency step for the platform.

Returns
Step frequency.

Implements geopm::FrequencyGovernor.

◆ init_platform_io()

void geopm::FrequencyGovernorImp::init_platform_io ( void  )
overridevirtual

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

Implements geopm::FrequencyGovernor.

◆ set_domain_type()

void geopm::FrequencyGovernorImp::set_domain_type ( int  domain_type)
overridevirtual

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.

Implements geopm::FrequencyGovernor.

◆ set_frequency_bounds()

bool geopm::FrequencyGovernorImp::set_frequency_bounds ( double  freq_min,
double  freq_max 
)
overridevirtual

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.

Implements geopm::FrequencyGovernor.

◆ validate_policy()

void geopm::FrequencyGovernorImp::validate_policy ( double &  freq_min,
double &  freq_max 
) const
overridevirtual

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.

Implements geopm::FrequencyGovernor.


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