diff options
author | Moritz Pflanzer <moritz.pflanzer@arm.com> | 2017-08-30 12:47:06 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | 09e4f98e31a9bb77bebeccd59c70f0715ab2c292 (patch) | |
tree | dcf5992df5961042a221cb426372eeb21a2d8023 /tests/framework/instruments/PMUCounter.h | |
parent | 906443f38fe2c168f4a0b2db5cd9852865fc4922 (diff) | |
download | ComputeLibrary-09e4f98e31a9bb77bebeccd59c70f0715ab2c292.tar.gz |
COMPMID-482: Refactor PMU counters
Change-Id: I9b254ce693363ecbbd7c188d211c85471134a91e
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/84328
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'tests/framework/instruments/PMUCounter.h')
-rw-r--r-- | tests/framework/instruments/PMUCounter.h | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/tests/framework/instruments/PMUCounter.h b/tests/framework/instruments/PMUCounter.h index f407be602f..7beb6d931d 100644 --- a/tests/framework/instruments/PMUCounter.h +++ b/tests/framework/instruments/PMUCounter.h @@ -25,6 +25,7 @@ #define ARM_COMPUTE_TEST_PMU_COUNTER #include "Instrument.h" +#include "PMU.h" namespace arm_compute { @@ -33,36 +34,18 @@ namespace test namespace framework { /** Implementation of an instrument to count CPU cycles. */ -class CycleCounter : public Instrument +class PMUCounter : public Instrument { public: - /** Initialise the cycle counter. */ - CycleCounter(); - - std::string id() const override; - void start() override; - void stop() override; - Measurement measurement() const override; + std::string id() const override; + void start() override; + void stop() override; + MeasurementsMap measurements() const override; private: - long _fd{ -1 }; + PMU _pmu_cycles{ PERF_COUNT_HW_CPU_CYCLES }; + PMU _pmu_instructions{ PERF_COUNT_HW_INSTRUCTIONS }; long long _cycles{ 0 }; -}; - -/** Implementation of an instrument to count executed CPU instructions. */ -class InstructionCounter : public Instrument -{ -public: - /** Initialise the instruction counter. */ - InstructionCounter(); - - std::string id() const override; - void start() override; - void stop() override; - Measurement measurement() const override; - -private: - long _fd{ -1 }; long long _instructions{ 0 }; }; } // namespace framework |