geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
DomainNetMap.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 DOMAINNETMAP_HPP_INCLUDE
7 #define DOMAINNETMAP_HPP_INCLUDE
8 
9 #include <memory>
10 #include <vector>
11 #include <map>
12 
13 #include "geopm_topo.h"
14 
15 namespace geopm
16 {
17 
22  {
23  public:
43  static std::unique_ptr<DomainNetMap> make_unique(const std::string &nn_path,
44  geopm_domain_e domain_type,
45  int domain_index);
65  static std::shared_ptr<DomainNetMap> make_shared(const std::string &nn_path,
66  geopm_domain_e domain_type,
67  int domain_index);
68 
69  virtual ~DomainNetMap() = default;
72  virtual void sample() = 0;
74  virtual std::vector<std::string> trace_names() const = 0;
78  virtual std::vector<double> trace_values() const = 0;
82  virtual std::map<std::string, double> last_output() const = 0;
83  };
84 }
85 
86 #endif /* DOMAINNETMAP_HPP_INCLUDE */
Class to load neural net from file, sample signals specified in that file, feed those signals into th...
Definition: DomainNetMap.hpp:22
static std::unique_ptr< DomainNetMap > make_unique(const std::string &nn_path, geopm_domain_e domain_type, int domain_index)
Returns a unique_ptr to a concrete object constructed using the underlying implementation which loads...
Definition: DomainNetMap.cpp:26
virtual std::map< std::string, double > last_output() const =0
Populates a map of trace names to the latest output from the neural net.
virtual std::vector< std::string > trace_names() const =0
generates the names for trace columns from the appropriate field in the neural net
virtual std::vector< double > trace_values() const =0
Populates trace values from last_output for each index within each domain type.
virtual void sample()=0
Samples latest signals for a specific domain and applies the resulting TensorOneD state to the neural...
static std::shared_ptr< DomainNetMap > make_shared(const std::string &nn_path, geopm_domain_e domain_type, int domain_index)
Returns a shared_ptr to a concrete object constructed using the underlying implementation which loads...
Definition: DomainNetMap.cpp:33
virtual ~DomainNetMap()=default
Definition: Accumulator.cpp:12