20.11
Instrument.hpp
Go to the documentation of this file.
1
//
2
// Copyright © 2017 Arm Ltd. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
6
#pragma once
7
8
#include <string>
9
#include <vector>
10
11
namespace
armnn
12
{
13
14
struct
Measurement
15
{
16
enum
Unit
17
{
18
TIME_NS
,
19
TIME_US
,
20
TIME_MS
,
21
};
22
23
inline
static
const
char
*
ToString
(
Unit
unit)
24
{
25
switch
(unit)
26
{
27
case
TIME_NS
:
return
"ns"
;
28
case
TIME_US
:
return
"us"
;
29
case
TIME_MS
:
return
"ms"
;
30
default
:
return
""
;
31
}
32
}
33
34
Measurement
(
const
std::string& name,
double
value,
Unit
unit)
35
:
m_Name
(name)
36
,
m_Value
(value)
37
,
m_Unit
(unit)
38
{}
39
Measurement
(
const
Measurement
&) =
default
;
40
~Measurement
() =
default
;
41
42
std::string
m_Name
;
43
double
m_Value
;
44
Unit
m_Unit
;
45
46
private
:
47
// please don't default construct, otherwise Units will be wrong
48
Measurement
() =
delete
;
49
};
50
51
class
Instrument
52
{
53
public
:
54
virtual
~Instrument
() {}
55
56
virtual
void
Start() = 0;
57
58
virtual
void
Stop() = 0;
59
60
virtual
std::vector<Measurement> GetMeasurements()
const
= 0;
61
62
virtual
const
char
* GetName()
const
= 0;
63
64
};
65
66
}
//namespace armnn
armnn::Measurement::m_Unit
Unit m_Unit
Definition:
Instrument.hpp:44
armnn::Measurement::Unit
Unit
Definition:
Instrument.hpp:16
armnn::Measurement::ToString
static const char * ToString(Unit unit)
Definition:
Instrument.hpp:23
armnn::Measurement::m_Name
std::string m_Name
Definition:
Instrument.hpp:42
armnn::Measurement
Definition:
Instrument.hpp:14
armnn
Copyright (c) 2020 ARM Limited.
Definition:
00_introduction.dox:25
armnn::Measurement::TIME_NS
Definition:
Instrument.hpp:18
armnn::Measurement::Measurement
Measurement(const std::string &name, double value, Unit unit)
Definition:
Instrument.hpp:34
armnn::Measurement::TIME_MS
Definition:
Instrument.hpp:20
armnn::Instrument::~Instrument
virtual ~Instrument()
Definition:
Instrument.hpp:54
armnn::Measurement::~Measurement
~Measurement()=default
armnn::Measurement::m_Value
double m_Value
Definition:
Instrument.hpp:43
armnn::Measurement::TIME_US
Definition:
Instrument.hpp:19
armnn::Instrument
Definition:
Instrument.hpp:51
src
armnn
Instrument.hpp
Generated on Wed Nov 25 2020 09:59:10 for ArmNN by
1.8.13