diff options
author | telsoa01 <telmo.soares@arm.com> | 2018-08-31 09:22:23 +0100 |
---|---|---|
committer | telsoa01 <telmo.soares@arm.com> | 2018-08-31 09:22:23 +0100 |
commit | c577f2c6a3b4ddb6ba87a882723c53a248afbeba (patch) | |
tree | bd7d4c148df27f8be6649d313efb24f536b7cf34 /src/armnn/Instrument.hpp | |
parent | 4c7098bfeab1ffe1cdc77f6c15548d3e73274746 (diff) | |
download | armnn-c577f2c6a3b4ddb6ba87a882723c53a248afbeba.tar.gz |
Release 18.08
Diffstat (limited to 'src/armnn/Instrument.hpp')
-rw-r--r-- | src/armnn/Instrument.hpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/armnn/Instrument.hpp b/src/armnn/Instrument.hpp new file mode 100644 index 0000000000..8d3ac5a76c --- /dev/null +++ b/src/armnn/Instrument.hpp @@ -0,0 +1,66 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// See LICENSE file in the project root for full license information. +// + +#pragma once + +#include <string> +#include <vector> + +namespace armnn +{ + +struct Measurement +{ + enum Unit + { + TIME_NS, + TIME_US, + TIME_MS, + }; + + inline static const char* ToString(Unit unit) + { + switch (unit) + { + case TIME_NS: return "ns"; + case TIME_US: return "us"; + case TIME_MS: return "ms"; + default: return ""; + } + } + + Measurement(const std::string& name, double value, Unit unit) + : m_Name(name) + , m_Value(value) + , m_Unit(unit) + {} + Measurement(const Measurement&) = default; + ~Measurement() = default; + + std::string m_Name; + double m_Value; + Unit m_Unit; + +private: + // please don't default construct, otherwise Units will be wrong + Measurement() = delete; +}; + +class Instrument +{ +public: + virtual ~Instrument() {} + + virtual void Start() = 0; + + virtual void Stop() = 0; + + virtual std::vector<Measurement> GetMeasurements() const = 0; + + virtual const char* GetName() const = 0; + +}; + +} //namespace armnn |