Optimized Belief Propagation (CPU and GPU)
EvaluateAcrossRuns.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2024 Scott Grauer-Gray
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18 
29 #ifndef EVALUATE_ACROSS_RUNS_H_
30 #define EVALUATE_ACROSS_RUNS_H_
31 
32 #include <string>
33 #include <vector>
34 #include <filesystem>
35 #include "RunEvalConstsEnums.h"
36 #include "RunResultsSpeedups.h"
37 
43  std::map<std::string, std::map<std::string, std::vector<std::string>>> speedup_results_name_to_data;
44  std::map<std::string, std::map<InputSignature, std::string>> input_to_runtime_across_archs;
45  std::map<InputSignature, std::vector<std::string>> inputs_to_params_disp_ordered;
46  std::vector<std::string> speedup_headers;
47 };
48 
55 public:
67  void operator()(
68  const std::filesystem::path& imp_results_file_path,
69  const std::vector<std::string>& eval_across_runs_top_text,
70  const std::vector<std::string>& eval_across_runs_in_params_show) const;
71 
72 private:
73 
82  EvalAcrossRunsData GenEvalAcrossRunsData(
83  const std::map<std::string, RunResultsSpeedups>& run_results_by_name,
84  const std::vector<std::string>& eval_across_runs_in_params_show) const;
85 
95  std::vector<std::string> OrderedRunNames(
96  const EvalAcrossRunsData& eval_data,
97  const std::optional<std::string>& speedup_header = std::optional<std::string>()) const;
98 
106  std::vector<std::string> GetRunNames(
107  const std::filesystem::path& imp_results_file_path) const;
108 
118  void WriteEvalAcrossRunsToFile(
119  const std::filesystem::path& imp_results_file_path,
120  const std::vector<std::string>& eval_across_runs_top_text,
121  const std::vector<std::string>& eval_across_runs_in_params_show,
122  const EvalAcrossRunsData& eval_data,
123  const std::vector<std::string>& run_names_ordered) const;
124 };
125 
126 #endif //EVALUATE_ACROSS_RUNS_H_
Contains namespace with enums and constants for implementation run evaluation.
Declares class to load and store run results data including speedups from evaluation.
Class with operator function to evaluate implementation runs across multiple architectures....
void operator()(const std::filesystem::path &imp_results_file_path, const std::vector< std::string > &eval_across_runs_top_text, const std::vector< std::string > &eval_across_runs_in_params_show) const
Evaluate all runs with results in specified file path and generate csv file with evaluation of result...
Structure to store data with mappings for evaluating results across runs as well as speedup headers i...
std::map< std::string, std::map< InputSignature, std::string > > input_to_runtime_across_archs
std::map< std::string, std::map< std::string, std::vector< std::string > > > speedup_results_name_to_data
std::map< InputSignature, std::vector< std::string > > inputs_to_params_disp_ordered
std::vector< std::string > speedup_headers