ArmNN  NotReleased
ProfilingEvent.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 <stack>
9 #include <vector>
10 #include <chrono>
11 #include <memory>
12 #include "Instrument.hpp"
13 #include "armnn/Types.hpp"
14 
15 namespace armnn
16 {
17 
19 class Profiler;
20 
23 class Event
24 {
25 public:
26  using InstrumentPtr = std::unique_ptr<Instrument>;
27  using Instruments = std::vector<InstrumentPtr>;
28 
29  Event(const std::string& eventName,
30  Profiler* profiler,
31  Event* parent,
32  const BackendId backendId,
33  std::vector<InstrumentPtr>&& instrument);
34 
35  Event(const Event& other) = delete;
36 
38  Event(Event&& other) noexcept;
39 
41  ~Event() noexcept;
42 
44  void Start();
45 
47  void Stop();
48 
51  const std::vector<Measurement> GetMeasurements() const;
52 
55  const std::string& GetName() const;
56 
59  const Profiler* GetProfiler() const;
60 
63  const Event* GetParentEvent() const;
64 
67  BackendId GetBackendId() const;
68 
70  Event& operator=(const Event& other) = delete;
71 
73  Event& operator=(Event&& other) noexcept;
74 
75 private:
77  std::string m_EventName;
78 
80  Profiler* m_Profiler;
81 
83  Event* m_Parent;
84 
86  BackendId m_BackendId;
87 
89  Instruments m_Instruments;
90 };
91 
92 } // namespace armnn
Event(const std::string &eventName, Profiler *profiler, Event *parent, const BackendId backendId, std::vector< InstrumentPtr > &&instrument)
const Profiler * GetProfiler() const
void Stop()
Stop the Event.
~Event() noexcept
Destructor.
std::vector< InstrumentPtr > Instruments
BackendId GetBackendId() const
const Event * GetParentEvent() const
void Start()
Start the Event.
std::unique_ptr< Instrument > InstrumentPtr
const std::string & GetName() const
const std::vector< Measurement > GetMeasurements() const