PandA-2024.02
profiling_information.hpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
42 #ifndef PROFILING_INFORMATION_HPP
43 #define PROFILING_INFORMATION_HPP
44 
46 #include "config_HAVE_UNORDERED.hpp"
47 
49 #include "basic_block.hpp"
50 
52 #include "graph.hpp"
53 
55 #include "custom_map.hpp"
56 #include "custom_set.hpp"
57 
59 #include "refcount.hpp"
60 
63 class xml_element;
64 
68 #if HAVE_UNORDERED
70  : public CustomUnorderedMap<unsigned int, std::map<CustomOrderedSet<unsigned int>, long double>>
71 {
72 };
73 #else
74 class PathProfilingInformation : public std::map<unsigned int, std::map<CustomOrderedSet<unsigned int>, long double>>
75 {
76 };
77 #endif
78 
82 #if HAVE_UNORDERED
83 class BBExecutions : public CustomUnorderedMap<vertex, unsigned long long int>
84 {
85  public:
90  explicit BBExecutions(const BBGraphConstRef bb_graph);
91 };
92 #else
93 class BBExecutions : public std::map<vertex, unsigned long long int, BBVertexSorter>
94 {
95  public:
100  explicit BBExecutions(const BBGraphConstRef bb_graph);
101 };
102 #endif
103 
107 #if HAVE_UNORDERED
108 class BBEdgeExecutions : public CustomUnorderedMap<EdgeDescriptor, unsigned long long int>
109 {
110  public:
115  explicit BBEdgeExecutions(const BBGraphConstRef bb_graph);
116 };
117 #else
118 class BBEdgeExecutions : public std::map<EdgeDescriptor, unsigned long long int, BBEdgeSorter>
119 {
120  public:
125  explicit BBEdgeExecutions(const BBGraphConstRef bb_graph);
126 };
127 #endif
128 
132 #if HAVE_UNORDERED
133 class AvgIterations : public CustomUnorderedMap<unsigned int, long double>
134 {
135 };
136 #else
137 class AvgIterations : public std::map<unsigned int, long double>
138 {
139 };
140 #endif
141 
145 #if HAVE_UNORDERED
146 class Iterations : public CustomUnorderedMap<unsigned int, unsigned long long int>
147 {
148 };
149 #else
150 class Iterations : public std::map<unsigned int, unsigned long long int>
151 {
152 };
153 #endif
154 
159 {
160  private:
162  friend class BasicBlocksProfiling;
163  friend class hpp_profiling;
164  friend class LoopsProfiling;
165  friend class probability_path;
166  friend class HostProfiling;
167  friend class read_profiling_data;
168  friend class tp_profiling;
169 
173 
176 
179 
182 
186 
189 
190  public:
195  explicit ProfilingInformation(const BBGraphConstRef bb_graph);
196 
201 
206  const PathProfilingInformation& GetPathProfiling() const;
207 
213  unsigned long long int GetBBExecutions(const vertex bb_vertex) const;
214 
220  unsigned long long int GetEdgeExecutions(const EdgeDescriptor edge) const;
221 
227  long double GetLoopAvgIterations(const unsigned int loop_id) const;
228 
234  unsigned long long int GetLoopMaxIterations(const unsigned int loop_id) const;
235 
241  unsigned long long GetLoopAbsIterations(const unsigned int loop_id) const;
242 
248  long double GetLoopAvgIterations(const LoopConstRef loop) const;
249 
255  unsigned long long int GetLoopMaxIterations(const LoopConstRef loop) const;
256 
262  unsigned long long GetLoopAbsIterations(const LoopConstRef loop) const;
263 
269  void WriteToXml(xml_element* root, const BBGraphConstRef fcfg) const;
270 
274  void Clear();
275 };
276 
278 
279 #endif
Class specification of the graph structures.
PathProfilingInformation path_profiling
map that represents, for each execution path of each loop (represented by the set of the executed con...
Map storing number of executions of each basic block edge.
Iterations abs_iterations
number of absolute execution (different from number of execution of the header); correspond to how ma...
Definition of the profiling information class.
CONSTREF_FORWARD_DECL(BBGraph)
Autoheader.
Map storing number of abs/max iterations.
redefinition of map to manage ordered/unordered structures
Map storing path profiling information.
Class to perform profiling.
Iterations max_iterations
Maximum number of iterations.
Class used to describe a particular graph with basic blocks as nodes.
unsigned map[NUM_VERTICES]
Definition: bfs.c:12
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
Definition: custom_map.hpp:148
redefinition of set to manage ordered/unordered structures
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
Definition: loop.hpp:153
BBEdgeExecutions edge_executions
Absolute number of running of edges.
Template definition of refcount.
Map storing number of average iterations.
BBExecutions bb_executions
Absolute number of execution of each basic block.
Class specification of the basic_block structure.
Map storing number of executions of each basic block.
Class to perform profiling.
AvgIterations avg_iterations
number of average iterations for one loop execution
boost::graph_traits< graph >::edge_descriptor EdgeDescriptor
edge definition.
Definition: graph.hpp:1316

Generated on Mon Feb 12 2024 13:02:50 for PandA-2024.02 by doxygen 1.8.13