Definition at line 29 of file timer.cc.
◆ ~ProfileStats()
Definition at line 41 of file timer.cc.
References rnnlm::i, KALDI_LOG, and ProfileStats::map_.
44 std::unordered_map<std::string, double> total_time;
45 for (
auto iter =
map_.begin(); iter !=
map_.end(); iter++)
46 total_time[iter->second.name] += iter->second.total_time;
48 ReverseSecondComparator comp;
49 std::vector<std::pair<std::string, double> > pairs(total_time.begin(),
51 std::sort(pairs.begin(), pairs.end(), comp);
52 for (
size_t i = 0;
i < pairs.size();
i++) {
53 KALDI_LOG <<
"Time taken in " << pairs[
i].first <<
" is " 54 << std::fixed << std::setprecision(2) << pairs[
i].second <<
"s.";
std::unordered_map< const char *, ProfileStatsEntry > map_
◆ AccStats()
void AccStats |
( |
const char * |
function_name, |
|
|
double |
elapsed |
|
) |
| |
|
inline |
Definition at line 31 of file timer.cc.
References ProfileStats::map_.
Referenced by Profiler::~Profiler().
32 std::unordered_map<const char*, ProfileStatsEntry>::iterator
33 iter =
map_.find(function_name);
34 if (iter ==
map_.end()) {
35 map_[function_name] = ProfileStatsEntry(function_name);
36 map_[function_name].total_time = elapsed;
38 iter->second.total_time += elapsed;
std::unordered_map< const char *, ProfileStatsEntry > map_
◆ map_
The documentation for this class was generated from the following file: