diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2017-10-31 17:59:17 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | ce58a9f8f8504c165ca4527bfd991a4029437cba (patch) | |
tree | c4360d11603912aa2e1915e5c25e42062218aaa5 /tests/framework/instruments/Instruments.cpp | |
parent | 82afedf2598c8fc5a428ecbd729dd8204b46fd43 (diff) | |
download | ComputeLibrary-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/Instruments.cpp')
-rw-r--r-- | tests/framework/instruments/Instruments.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/tests/framework/instruments/Instruments.cpp b/tests/framework/instruments/Instruments.cpp index eca6d6f437..641e6305cd 100644 --- a/tests/framework/instruments/Instruments.cpp +++ b/tests/framework/instruments/Instruments.cpp @@ -34,18 +34,28 @@ namespace test { namespace framework { -InstrumentType instrument_type_from_name(const std::string &name) +InstrumentsDescription instrument_type_from_name(const std::string &name) { - static const std::map<std::string, InstrumentType> types = + static const std::map<std::string, framework::InstrumentsDescription> types = { - { "all", InstrumentType::ALL }, - { "none", InstrumentType::NONE }, - { "wall_clock", InstrumentType::WALL_CLOCK_TIMER }, - { "pmu", InstrumentType::PMU }, - { "pmu_cycles", InstrumentType::PMU_CYCLE_COUNTER }, - { "pmu_instructions", InstrumentType::PMU_INSTRUCTION_COUNTER }, - { "mali", InstrumentType::MALI }, - { "opencl_timer", InstrumentType::OPENCL_TIMER }, + { "all", std::pair<InstrumentType, ScaleFactor>(InstrumentType::ALL, ScaleFactor::NONE) }, + { "none", std::pair<InstrumentType, ScaleFactor>(InstrumentType::NONE, ScaleFactor::NONE) }, + { "wall_clock", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::NONE) }, + { "wall_clock_timer", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::NONE) }, + { "wall_clock_timer_ms", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::TIME_MS) }, + { "wall_clock_timer_s", std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::TIME_S) }, + { "pmu", std::pair<InstrumentType, ScaleFactor>(InstrumentType::PMU, ScaleFactor::NONE) }, + { "pmu_k", std::pair<InstrumentType, ScaleFactor>(InstrumentType::PMU, ScaleFactor::SCALE_1K) }, + { "pmu_m", std::pair<InstrumentType, ScaleFactor>(InstrumentType::PMU, ScaleFactor::SCALE_1M) }, + { "pmu_cycles", std::pair<InstrumentType, ScaleFactor>(InstrumentType::PMU_CYCLE_COUNTER, ScaleFactor::NONE) }, + { "pmu_instructions", std::pair<InstrumentType, ScaleFactor>(InstrumentType::PMU_INSTRUCTION_COUNTER, ScaleFactor::NONE) }, + { "mali", std::pair<InstrumentType, ScaleFactor>(InstrumentType::MALI, ScaleFactor::NONE) }, + { "mali_k", std::pair<InstrumentType, ScaleFactor>(InstrumentType::MALI, ScaleFactor::SCALE_1K) }, + { "mali_m", std::pair<InstrumentType, ScaleFactor>(InstrumentType::MALI, ScaleFactor::SCALE_1M) }, + { "opencl_timer", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMER, ScaleFactor::NONE) }, + { "opencl_timer_us", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMER, ScaleFactor::TIME_US) }, + { "opencl_timer_ms", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMER, ScaleFactor::TIME_MS) }, + { "opencl_timer_s", std::pair<InstrumentType, ScaleFactor>(InstrumentType::OPENCL_TIMER, ScaleFactor::TIME_S) }, }; try |