geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
SSTClosGovernor.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 SSTCLOSGOVERNOR_HPP_INCLUDE
7 #define SSTCLOSGOVERNOR_HPP_INCLUDE
8 
9 #include <map>
10 #include <memory>
11 #include <string>
12 #include <vector>
13 
14 namespace geopm
15 {
16  class PlatformIO;
17  class PlatformTopo;
18 
21  {
22  public:
23  enum ClosLevel_e {
28  };
29 
30  SSTClosGovernor() = default;
31  virtual ~SSTClosGovernor() = default;
32 
35  virtual void init_platform_io(void) = 0;
36 
42  virtual int clos_domain_type(void) const = 0;
43 
46  virtual void adjust_platform(const std::vector<double> &clos_by_core) = 0;
47 
51  virtual bool do_write_batch(void) const = 0;
52 
56  virtual void enable_sst_turbo_prioritization() = 0;
57 
62 
65  static bool is_supported(PlatformIO &platform_io);
66 
67  static std::unique_ptr<SSTClosGovernor> make_unique(void);
68  static std::shared_ptr<SSTClosGovernor> make_shared(void);
69  };
70 }
71 
72 #endif // SSTCLOSGOVERNOR_HPP_INCLUDE
Govern class of service (CLOS) controls.
Definition: SSTClosGovernor.hpp:21
static bool is_supported(PlatformIO &platform_io)
Definition: SSTClosGovernor.cpp:55
static std::shared_ptr< SSTClosGovernor > make_shared(void)
Definition: SSTClosGovernor.cpp:29
virtual void disable_sst_turbo_prioritization()=0
virtual bool do_write_batch(void) const =0
Returns true if the last call to adjust_platform requires writing controls.
virtual ~SSTClosGovernor()=default
virtual void enable_sst_turbo_prioritization()=0
virtual void adjust_platform(const std::vector< double > &clos_by_core)=0
Write CLOS controls.
ClosLevel_e
Definition: SSTClosGovernor.hpp:23
@ MEDIUM_HIGH_PRIORITY
Definition: SSTClosGovernor.hpp:25
@ HIGH_PRIORITY
Definition: SSTClosGovernor.hpp:24
@ MEDIUM_LOW_PRIORITY
Definition: SSTClosGovernor.hpp:26
@ LOW_PRIORITY
Definition: SSTClosGovernor.hpp:27
virtual void init_platform_io(void)=0
Registers signals and controls with PlatformIO using the default control domain.
virtual int clos_domain_type(void) const =0
Get the domain type of CLOS control on the platform. Users of the SSTClosGovernor can use this inform...
static std::unique_ptr< SSTClosGovernor > make_unique(void)
Definition: SSTClosGovernor.cpp:24
Definition: Accumulator.cpp:12