From 35aa6a36e7ef9302efd554aac9b84153ad7c6a9e Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Mon, 23 Apr 2018 16:12:12 +0100 Subject: COMPMID-1077 Add OpenCL Memory Usage instrument Change-Id: Ic5a24f22bec9d6ca71486097f6ad70fb0d83da2b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128674 Reviewed-by: Georgios Pinitas Tested-by: Jenkins --- tests/framework/instruments/Instruments.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/framework/instruments/Instruments.h') diff --git a/tests/framework/instruments/Instruments.h b/tests/framework/instruments/Instruments.h index fe4c719319..705fc59b29 100644 --- a/tests/framework/instruments/Instruments.h +++ b/tests/framework/instruments/Instruments.h @@ -25,6 +25,7 @@ #define ARM_COMPUTE_TEST_INSTRUMENTS #include "MaliCounter.h" +#include "OpenCLMemoryUsage.h" #include "OpenCLTimer.h" #include "PMUCounter.h" #include "SchedulerTimer.h" @@ -50,6 +51,7 @@ enum class InstrumentType : unsigned int MALI = 0x0300, OPENCL_TIMER = 0x0400, SCHEDULER_TIMER = 0x0500, + OPENCL_MEMORY_USAGE = 0x0600, }; using InstrumentsDescription = std::pair; @@ -157,6 +159,22 @@ inline ::std::stringstream &operator<<(::std::stringstream &stream, InstrumentsD throw std::invalid_argument("Unsupported instrument scale"); } break; + case InstrumentType::OPENCL_MEMORY_USAGE: + switch(instrument.second) + { + case ScaleFactor::NONE: + stream << "OPENCL_MEMORY_USAGE"; + break; + case ScaleFactor::SCALE_1K: + stream << "OPENCL_MEMORY_USAGE_K"; + break; + case ScaleFactor::SCALE_1M: + stream << "OPENCL_MEMORY_USAGE_M"; + break; + default: + throw std::invalid_argument("Unsupported instrument scale"); + } + break; case InstrumentType::ALL: stream << "ALL"; break; -- cgit v1.2.1