2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
6 #include "Profiling.hpp"
7 #include "ProfilingEvent.hpp"
11 Event::Event(const std::string& eventName,
14 const Compute computeDevice,
15 std::vector<InstrumentPtr>&& instruments)
16 : m_EventName(eventName)
17 , m_Profiler(profiler)
19 , m_ComputeDevice(computeDevice)
20 , m_Instruments(std::move(instruments))
24 Event::Event(Event&& other) noexcept
25 : m_EventName(std::move(other.m_EventName))
26 , m_Profiler(other.m_Profiler)
27 , m_Parent(other.m_Parent)
28 , m_ComputeDevice(other.m_ComputeDevice)
29 , m_Instruments(std::move(other.m_Instruments))
34 Event::~Event() noexcept
40 for (auto& instrument : m_Instruments)
48 for (auto& instrument : m_Instruments)
54 const std::vector<Measurement> Event::GetMeasurements() const
56 std::vector<Measurement> measurements;
57 for (auto& instrument : m_Instruments)
59 for (auto& measurement : instrument->GetMeasurements())
61 measurements.emplace_back(std::move(measurement));
67 const std::string& Event::GetName() const
72 const Profiler* Event::GetProfiler() const
77 const Event* Event::GetParentEvent() const
82 Compute Event::GetComputeDevice() const
84 return m_ComputeDevice;
87 Event& Event::operator=(Event&& other) noexcept
94 m_EventName = other.m_EventName;
95 m_Profiler = other.m_Profiler;
96 m_Parent = other.m_Parent;
97 m_ComputeDevice = other.m_ComputeDevice;
98 other.m_Profiler = nullptr;
99 other.m_Parent = nullptr;