TCPSPSuite
autotuneconfig.hpp
1 #ifndef AUTOTUNECONFIG_H
2 #define AUTOTUNECONFIG_H
3 
4 #include "../datastructures/maybe.hpp" // for Maybe
5 #include "../util/log.hpp" // for Log
6 #include "parameter.hpp" // for Parameters
7 #include "solverconfig.hpp" // for SolverConfig
8 #include <json.hpp> // for json
9 #include <string> // for string, allocator
10 #include <vector> // for vector
11 
12 using json = nlohmann::json;
13 
14 class AutotuneConfig {
15 public:
16  static AutotuneConfig *
17  get()
18  {
19  if (instance == nullptr) {
20  instance = new AutotuneConfig;
21  }
22  return instance;
23  }
24 
25  bool parse_cmdline(int argc, const char ** argv);
26 
30  bool nextConfig();
31 
35  SolverConfig generateConfig();
36 
37  AutotuneConfig(const AutotuneConfig &) = delete;
38 
39 private:
40  AutotuneConfig();
41  int current_config;
42  size_t current_parameter_group;
43 
44  void read_auto_config(std::string file);
45 
46  static AutotuneConfig * instance;
47 
48  std::vector<std::vector<Parameter>> parameters;
49  Log l;
50 };
51 
52 #endif