Optimized Belief Propagation (CPU and GPU)
DetailedTimingBpConsts.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 
27 #ifndef DETAILED_TIMING_BP_CONSTS_H_
28 #define DETAILED_TIMING_BP_CONSTS_H_
29 
30 #include <array>
31 #include <string>
32 #include <unordered_map>
33 
34 namespace beliefprop {
35 
39 constexpr std::array<std::array<std::string_view, 3>, 10> kLevelDCostBpTimeCTimeNames{
40  std::array<std::string_view, 3>{"Level 0 Data Costs", "Level 0 BP Runtime", "Level 0 Copy Runtime"},
41  std::array<std::string_view, 3>{"Level 1 Data Costs", "Level 1 BP Runtime", "Level 1 Copy Runtime"},
42  std::array<std::string_view, 3>{"Level 2 Data Costs", "Level 2 BP Runtime", "Level 2 Copy Runtime"},
43  std::array<std::string_view, 3>{"Level 3 Data Costs", "Level 3 BP Runtime", "Level 3 Copy Runtime"},
44  std::array<std::string_view, 3>{"Level 4 Data Costs", "Level 4 BP Runtime", "Level 4 Copy Runtime"},
45  std::array<std::string_view, 3>{"Level 5 Data Costs", "Level 5 BP Runtime", "Level 5 Copy Runtime"},
46  std::array<std::string_view, 3>{"Level 6 Data Costs", "Level 6 BP Runtime", "Level 6 Copy Runtime"},
47  std::array<std::string_view, 3>{"Level 7 Data Costs", "Level 7 BP Runtime", "Level 7 Copy Runtime"},
48  std::array<std::string_view, 3>{"Level 8 Data Costs", "Level 8 BP Runtime", "Level 8 Copy Runtime"},
49  std::array<std::string_view, 3>{"Level 9 Data Costs", "Level 9 BP Runtime", "Level 9 Copy Runtime"}
50 };
51 
54 enum class Runtime_Type {
64 
67 const std::unordered_map<Runtime_Type, std::string_view> kTimingNames{
68  {Runtime_Type::kInitSettingsMalloc, "Time init settings malloc"},
79  {Runtime_Type::kDataCostsHigherLevel, "Total time get data costs after bottom level"},
80  {Runtime_Type::kInitMessages, "Time to init message values"},
81  {Runtime_Type::kInitMessagesKernel, "Time to init message values (kernel portion only)"},
82  {Runtime_Type::kBpIters, "Total time BP Iters"},
83  {Runtime_Type::kCopyData, "Total time Copy Data"},
84  {Runtime_Type::kCopyDataKernel, "Total time Copy Data (kernel portion only)"},
85  {Runtime_Type::kCopyDataMemManagement, "Total time Copy Data (memory management portion only)"},
86  {Runtime_Type::kOutputDisparity, "Time get output disparity"},
87  {Runtime_Type::kFinalFree, "Time final free"},
88  {Runtime_Type::kTotalTimed, "Total timed"},
89  {Runtime_Type::kSmoothing, "Smoothing Runtime"},
110  {Runtime_Type::kTotalBp, "Total BP Runtime"},
111  {Runtime_Type::kTotalNoTransfer, "Total Runtime not including data transfer time"},
112  {Runtime_Type::kTotalWithTransfer, "Total runtime including data transfer time"}};
113 };
114 
115 #endif /* DETAILED_TIMING_BP_CONSTS_H_ */
Namespace for enums, constants, structures, and functions specific to belief propagation processing.
const std::unordered_map< Runtime_Type, std::string_view > kTimingNames
Mapping of runtime segment enum to header describing timing of the segment.
Runtime_Type
Enum for each runtime segment in belief propagation implementation shown in timing outputs.
constexpr std::array< std::array< std::string_view, 3 >, 10 > kLevelDCostBpTimeCTimeNames
Constant consisting of arrays of string views for headers corresponding to timing of computation of d...