geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
FrequencyLimitDetector.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 FREQUENCYLIMITDETECTOR_HPP_INCLUDE
7 #define FREQUENCYLIMITDETECTOR_HPP_INCLUDE
8 
9 #include <memory>
10 #include <utility>
11 #include <vector>
12 
13 namespace geopm
14 {
15  class PlatformIO;
16  class PlatformTopo;
17 
24  {
25  public:
27  virtual ~FrequencyLimitDetector() = default;
28 
36  const std::vector<double> &observed_core_frequencies) = 0;
37 
44  virtual std::vector<std::pair<unsigned int, double> > get_core_frequency_limits(
45  unsigned int core_idx) const = 0;
46 
49  unsigned int core_idx) const = 0;
50 
51  static std::unique_ptr<FrequencyLimitDetector> make_unique(
52  PlatformIO &platform_io, const PlatformTopo &platform_topo);
53 
54  static std::shared_ptr<FrequencyLimitDetector> make_shared(
55  PlatformIO &platform_io, const PlatformTopo &platform_topo);
56  };
57 }
58 
59 #endif
Detect maximum achievable frequency limits of CPU cores.
Definition: FrequencyLimitDetector.hpp:24
static std::unique_ptr< FrequencyLimitDetector > make_unique(PlatformIO &platform_io, const PlatformTopo &platform_topo)
Definition: FrequencyLimitDetector.cpp:35
virtual ~FrequencyLimitDetector()=default
virtual std::vector< std::pair< unsigned int, double > > get_core_frequency_limits(unsigned int core_idx) const =0
Estimate the maximum achievable frequencies of a given core.
virtual void update_max_frequency_estimates(const std::vector< double > &observed_core_frequencies)=0
Update the estimates for maximum achievable core frequencies.
virtual double get_core_low_priority_frequency(unsigned int core_idx) const =0
Estimate the low priority frequency of a given core.
static std::shared_ptr< FrequencyLimitDetector > make_shared(PlatformIO &platform_io, const PlatformTopo &platform_topo)
Definition: FrequencyLimitDetector.cpp:47
Definition: Accumulator.cpp:12