aboutsummaryrefslogtreecommitdiff
path: root/tests/framework/instruments/MaliCounter.cpp
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2017-11-09 10:29:59 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commitab14c15dc9a0f55664fe523aed072fffa60da420 (patch)
treeb5a90018b71d10cd5a7ac2f19acdb34354208baa /tests/framework/instruments/MaliCounter.cpp
parent33da05bc53a3de35c8b2fad04ab78d5b40d6aa77 (diff)
downloadComputeLibrary-ab14c15dc9a0f55664fe523aed072fffa60da420.tar.gz
COMPMID-663: Reworked / cleaned up instuments' measurements
Everything used to be stored as double which led to some numbers appearing in scientific notation and some counters values getting corrupted. Now measurements can be stored as either floating point or integer values. Added support for raw_data in order to output more detailed information to the JSON files (Will make use of that in the OpenCL timer instrument) Change-Id: Ie83776b347a764c8bf45b47d7d9d7bec02b04257 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95035 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/framework/instruments/MaliCounter.cpp')
-rw-r--r--tests/framework/instruments/MaliCounter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/framework/instruments/MaliCounter.cpp b/tests/framework/instruments/MaliCounter.cpp
index 6cc3ac5bcb..f36d1801a3 100644
--- a/tests/framework/instruments/MaliCounter.cpp
+++ b/tests/framework/instruments/MaliCounter.cpp
@@ -111,7 +111,7 @@ MaliCounter::MaliCounter()
{
_counters =
{
- { "GPU_ACTIVE", TypedMeasurement<uint64_t>(0, "cycles") },
+ { "GPU_ACTIVE", Measurement(0, "cycles") },
};
_core_counters =
@@ -373,8 +373,8 @@ void MaliCounter::stop()
sample_counters();
wait_next_event();
- const auto counter = get_counters(mali_userspace::MALI_NAME_BLOCK_JM);
- _counters.at("GPU_ACTIVE").value = counter[find_counter_index_by_name(mali_userspace::MALI_NAME_BLOCK_JM, "GPU_ACTIVE")];
+ const uint32_t *counter = get_counters(mali_userspace::MALI_NAME_BLOCK_JM);
+ _counters.at("GPU_ACTIVE") = Measurement(counter[find_counter_index_by_name(mali_userspace::MALI_NAME_BLOCK_JM, "GPU_ACTIVE")], _counters.at("GPU_ACTIVE").unit());
const int arith_index = find_counter_index_by_name(mali_userspace::MALI_NAME_BLOCK_SHADER, "ARITH_WORDS");
const int ls_index = find_counter_index_by_name(mali_userspace::MALI_NAME_BLOCK_SHADER, "LS_ISSUE");
@@ -385,7 +385,7 @@ void MaliCounter::stop()
// Shader core counters can be averaged if desired, but here we don't.
for(int core = 0; core < _num_cores; ++core)
{
- const auto sc_counter = get_counters(mali_userspace::MALI_NAME_BLOCK_SHADER, core);
+ const uint32_t *sc_counter = get_counters(mali_userspace::MALI_NAME_BLOCK_SHADER, core);
_core_counters.at("ARITH_WORDS").values[core] = sc_counter[arith_index];
_core_counters.at("LS_ISSUE").values[core] = sc_counter[ls_index];
@@ -406,7 +406,7 @@ Instrument::MeasurementsMap MaliCounter::measurements() const
{
MeasurementsMap measurements
{
- { "Timespan", TypedMeasurement<uint64_t>(_stop_time - _start_time, "ns") },
+ { "Timespan", Measurement(_stop_time - _start_time, "ns") },
{ "GPU active", _counters.at("GPU_ACTIVE") },
};
@@ -414,7 +414,7 @@ Instrument::MeasurementsMap MaliCounter::measurements() const
{
for(const auto &core : counter.second.values)
{
- measurements.emplace(counter.second.name + " #" + support::cpp11::to_string(core.first), TypedMeasurement<uint64_t>(core.second, counter.second.unit));
+ measurements.emplace(counter.second.name + " #" + support::cpp11::to_string(core.first), Measurement(core.second, counter.second.unit));
}
}