geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
FrequencyTimeBalancer.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef FREQUENCYTIMEBALANCER_HPP_INCLUDE
7 #define FREQUENCYTIMEBALANCER_HPP_INCLUDE
8 
9 #include <memory>
10 #include <vector>
11 
12 namespace geopm
13 {
21  {
22  public:
23  FrequencyTimeBalancer() = default;
24  virtual ~FrequencyTimeBalancer() = default;
25 
38  virtual std::vector<double> balance_frequencies_by_time(
39  const std::vector<double> &previous_times,
40  const std::vector<double> &previous_control_frequencies,
41  const std::vector<double> &previous_achieved_frequencies,
42  const std::vector<std::pair<unsigned int, double> > &frequency_limits_by_high_priority_count,
43  double low_priority_frequency) = 0;
44 
46  virtual double get_target_time() const = 0;
47 
53  static std::unique_ptr<FrequencyTimeBalancer> make_unique(
54  double minimum_frequency,
55  double maximum_frequency);
56 
58  static std::shared_ptr<FrequencyTimeBalancer> make_shared(
59  double minimum_frequency,
60  double maximum_frequency);
61  };
62 }
63 
64 #endif /* FREQUENCYTIMEBALANCER_HPP_INCLUDE */
Definition: FrequencyTimeBalancer.hpp:21
virtual double get_target_time() const =0
return the target time last used to balance the frequencies.
static std::shared_ptr< FrequencyTimeBalancer > make_shared(double minimum_frequency, double maximum_frequency)
Allocate a FrequencyTimeBalancer instance.
Definition: FrequencyTimeBalancer.cpp:278
virtual std::vector< double > balance_frequencies_by_time(const std::vector< double > &previous_times, const std::vector< double > &previous_control_frequencies, const std::vector< double > &previous_achieved_frequencies, const std::vector< std::pair< unsigned int, double > > &frequency_limits_by_high_priority_count, double low_priority_frequency)=0
Return the recommended frequency controls given observed times while operating under a given set of p...
static std::unique_ptr< FrequencyTimeBalancer > make_unique(double minimum_frequency, double maximum_frequency)
Allocate a FrequencyTimeBalancer instance.
Definition: FrequencyTimeBalancer.cpp:269
virtual ~FrequencyTimeBalancer()=default
Definition: Accumulator.cpp:12