aboutsummaryrefslogtreecommitdiff
path: root/tests/framework/instruments/MaliCounter.cpp
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2017-10-31 17:59:17 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commitce58a9f8f8504c165ca4527bfd991a4029437cba (patch)
treec4360d11603912aa2e1915e5c25e42062218aaa5 /tests/framework/instruments/MaliCounter.cpp
parent82afedf2598c8fc5a428ecbd729dd8204b46fd43 (diff)
downloadComputeLibrary-ce58a9f8f8504c165ca4527bfd991a4029437cba.tar.gz
COMPMID-622 Let the user choose the units for the instruments
Change-Id: Ic6ac4cd6df6970593a5e2e6310b6d61951c88898 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/93887 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/framework/instruments/MaliCounter.cpp')
-rw-r--r--tests/framework/instruments/MaliCounter.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/tests/framework/instruments/MaliCounter.cpp b/tests/framework/instruments/MaliCounter.cpp
index f36d1801a3..f3ec45d485 100644
--- a/tests/framework/instruments/MaliCounter.cpp
+++ b/tests/framework/instruments/MaliCounter.cpp
@@ -107,7 +107,7 @@ MaliHWInfo get_mali_hw_info(const char *path)
}
} // namespace
-MaliCounter::MaliCounter()
+MaliCounter::MaliCounter(ScaleFactor scale_factor)
{
_counters =
{
@@ -123,6 +123,24 @@ MaliCounter::MaliCounter()
{ "FRAG_ACTIVE", { "Fragment core", std::map<int, uint64_t>(), "cycles" } },
};
+ switch(scale_factor)
+ {
+ case ScaleFactor::NONE:
+ _scale_factor = 1;
+ _unit = "";
+ break;
+ case ScaleFactor::SCALE_1K:
+ _scale_factor = 1000;
+ _unit = "K ";
+ break;
+ case ScaleFactor::SCALE_1M:
+ _scale_factor = 1000000;
+ _unit = "M ";
+ break;
+ default:
+ ARM_COMPUTE_ERROR("Invalid scale");
+ }
+
init();
}
@@ -404,17 +422,19 @@ std::string MaliCounter::id() const
Instrument::MeasurementsMap MaliCounter::measurements() const
{
+ Measurement counters((_counters.at("GPU_ACTIVE").value() / _scale_factor).v.floating_point, _unit + _counters.at("GPU_ACTIVE").unit()); //NOLINT
+
MeasurementsMap measurements
{
{ "Timespan", Measurement(_stop_time - _start_time, "ns") },
- { "GPU active", _counters.at("GPU_ACTIVE") },
+ { "GPU active", counters },
};
for(const auto &counter : _core_counters)
{
for(const auto &core : counter.second.values)
{
- measurements.emplace(counter.second.name + " #" + support::cpp11::to_string(core.first), Measurement(core.second, counter.second.unit));
+ measurements.emplace(counter.second.name + " #" + support::cpp11::to_string(core.first), Measurement(core.second / _scale_factor, _unit + counter.second.unit));
}
}