Commit eaa54c43 authored by Philip Trettner's avatar Philip Trettner

Changed to sum of time

parent 30783920
......@@ -193,6 +193,8 @@ void GlowActionLabel::print(int maxLines)
{
struct Result
{
double sumCPU;
double sumGPU;
double avgCPU;
double avgGPU;
int count;
......@@ -222,13 +224,13 @@ void GlowActionLabel::print(int maxLines)
if (count == 0)
++count;
labels.push_back({sumCPU / count, sumGPU / count, count, l->shortDesc()});
labels.push_back({sumCPU, sumGPU, sumCPU / count, sumGPU / count, count, l->shortDesc()});
}
sLabelLock.unlock();
std::sort(begin(labels), end(labels), [](Result const &r, Result const &l)
{
return r.avgGPU > l.avgGPU;
return std::max(r.sumGPU, r.sumCPU) > std::max(l.sumGPU, l.sumCPU);
});
if (labels.size() == 0)
......@@ -237,9 +239,9 @@ void GlowActionLabel::print(int maxLines)
int wTime = 8;
int wCount = 6;
std::cout << aion_fmt::format("{:>" + std::to_string(wTime) + "} {:>" + std::to_string(wTime) + "} {:>"
+ std::to_string(wCount) + "} {}",
"GPU", "CPU", "Cnt", "Name")
std::cout << aion_fmt::format("{:>" + std::to_string(wTime) + "} {:>" + std::to_string(wTime) + "} {:>" + std::to_string(wTime)
+ "} {:>" + std::to_string(wTime) + "} {:>" + std::to_string(wCount) + "} {}",
"GPU Sum", "CPU Sum", "GPU", "CPU", "Cnt", "Name")
<< std::endl;
for (auto i = 0u; i < labels.size(); ++i)
{
......@@ -247,8 +249,9 @@ void GlowActionLabel::print(int maxLines)
break;
auto const &r = labels[i];
std::cout << aion_fmt::format("{:>" + std::to_string(wTime) + "} {:>" + std::to_string(wTime) + "} {:>"
+ std::to_string(wCount) + "} {}",
std::cout << aion_fmt::format("{:>" + std::to_string(wTime) + "} {:>" + std::to_string(wTime) + "} {:>" + std::to_string(wTime)
+ "} {:>" + std::to_string(wTime) + "} {:>" + std::to_string(wCount) + "} {}",
aion_systime::formatHuman(r.sumGPU), aion_systime::formatHuman(r.sumCPU),
aion_systime::formatHuman(r.avgGPU), aion_systime::formatHuman(r.avgCPU),
std::to_string(r.count) + "x", r.name)
<< std::endl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment