24.02
|
#include <Profiling.hpp>
Classes | |
struct | Marker |
struct | ProfilingEventStats |
Public Types | |
using | InstrumentPtr = std::unique_ptr< Instrument > |
using | EventPtr = std::unique_ptr< Event > |
using | DescPtr = std::unique_ptr< ProfilingDetails > |
Public Member Functions | |
ProfilerImpl () | |
~ProfilerImpl () | |
Event * | BeginEvent (armnn::IProfiler *profiler, const BackendId &backendId, const std::string &name, std::vector< InstrumentPtr > &&instruments, const Optional< arm::pipe::ProfilingGuid > &guid) |
template<typename DescriptorType > | |
void | AddLayerDetails (const std::string &label, const DescriptorType &desc, const WorkloadInfo &infos, const arm::pipe::ProfilingGuid guid) |
void | EndEvent (Event *event) |
void | EnableProfiling (bool enableProfiling) |
bool | IsProfilingEnabled () |
void | EnableNetworkDetailsToStdOut (ProfilingDetailsMethod detailsMethod) |
void | UpdateEventTag () |
void | AnalyzeEventsAndWriteResults (std::ostream &outStream) const |
void | Print (std::ostream &outStream) const |
uint32_t | GetEventColor (const BackendId &backendId) const |
template<typename EventIterType > | |
void | AnalyzeEventSequenceAndWriteResults (EventIterType first, EventIterType last, std::ostream &outStream) const |
std::map< std::string, ProfilingEventStats > | CalculateProfilingEventStats () const |
void | PopulateParent (std::vector< const Event * > &outEvents, int &outBaseLevel, std::string parentName) const |
void | PopulateDescendants (std::map< const Event *, std::vector< const Event * >> &outDescendantsMap) const |
template<typename ItertType > | |
void | AnalyzeEventSequenceAndWriteResults (ItertType first, ItertType last, std::ostream &outStream) const |
Public Attributes | |
std::stack< Event * > | m_Parents |
std::vector< EventPtr > | m_EventSequence |
DescPtr | m_ProfilingDetails = std::make_unique<ProfilingDetails>() |
bool | m_ProfilingEnabled |
ProfilingDetailsMethod | m_DetailsToStdOutMethod |
Definition at line 29 of file Profiling.hpp.
using DescPtr = std::unique_ptr<ProfilingDetails> |
Definition at line 79 of file Profiling.hpp.
Definition at line 78 of file Profiling.hpp.
using InstrumentPtr = std::unique_ptr<Instrument> |
Definition at line 34 of file Profiling.hpp.
ProfilerImpl | ( | ) |
Definition at line 164 of file Profiling.cpp.
References armnn::g_ProfilingEventCountHint, ProfilerImpl::m_EventSequence, and armnn::Undefined.
~ProfilerImpl | ( | ) |
Definition at line 176 of file Profiling.cpp.
References armnn::g_WriteReportToStdOutOnProfilerDestruction, ProfilerManager::GetInstance(), ProfilerImpl::m_ProfilingEnabled, ProfilerImpl::Print(), and ProfilerManager::RegisterProfiler().
|
inline |
Definition at line 45 of file Profiling.hpp.
References ProfilerImpl::m_ProfilingDetails.
void AnalyzeEventsAndWriteResults | ( | std::ostream & | outStream | ) | const |
Definition at line 481 of file Profiling.cpp.
References ProfilerImpl::AnalyzeEventSequenceAndWriteResults(), armnn::CalcLevel(), armnn::g_AggregateProfilingEventsByInference, ProfilerImpl::m_EventSequence, ProfilerImpl::m_Parents, ProfilerImpl::PopulateDescendants(), and ProfilerImpl::PopulateParent().
void AnalyzeEventSequenceAndWriteResults | ( | EventIterType | first, |
EventIterType | last, | ||
std::ostream & | outStream | ||
) | const |
Referenced by ProfilerImpl::AnalyzeEventsAndWriteResults().
void AnalyzeEventSequenceAndWriteResults | ( | ItertType | first, |
ItertType | last, | ||
std::ostream & | outStream | ||
) | const |
Definition at line 113 of file Profiling.cpp.
References ProfilerImpl::CalculateProfilingEventStats(), armnn::FindMeasurement(), armnn::g_WriteProfilingEventSequence, BackendId::Get(), Event::GetBackendId(), armnn::GetEventPtr(), Event::GetName(), ProfilerImpl::ProfilingEventStats::m_Count, ProfilerImpl::ProfilingEventStats::m_MaxMs, ProfilerImpl::ProfilingEventStats::m_MinMs, ProfilerImpl::ProfilingEventStats::m_TotalMs, Measurement::m_Value, WallClockTimer::WALL_CLOCK_TIME, WallClockTimer::WALL_CLOCK_TIME_START, and WallClockTimer::WALL_CLOCK_TIME_STOP.
Event * BeginEvent | ( | armnn::IProfiler * | profiler, |
const BackendId & | backendId, | ||
const std::string & | name, | ||
std::vector< InstrumentPtr > && | instruments, | ||
const Optional< arm::pipe::ProfilingGuid > & | guid | ||
) |
Definition at line 205 of file Profiling.cpp.
References ProfilerImpl::GetEventColor(), ProfilerImpl::m_EventSequence, and ProfilerImpl::m_Parents.
std::map< std::string, ProfilerImpl::ProfilingEventStats > CalculateProfilingEventStats | ( | ) | const |
Definition at line 82 of file Profiling.cpp.
References armnn::FindMeasurement(), ProfilerImpl::ProfilingEventStats::m_Count, ProfilerImpl::m_EventSequence, ProfilerImpl::ProfilingEventStats::m_MaxMs, ProfilerImpl::ProfilingEventStats::m_MinMs, ProfilerImpl::ProfilingEventStats::m_TotalMs, Measurement::m_Value, and WallClockTimer::WALL_CLOCK_TIME.
Referenced by ProfilerImpl::AnalyzeEventSequenceAndWriteResults().
void EnableNetworkDetailsToStdOut | ( | ProfilingDetailsMethod | detailsMethod | ) |
Definition at line 200 of file Profiling.cpp.
References ProfilerImpl::m_DetailsToStdOutMethod.
void EnableProfiling | ( | bool | enableProfiling | ) |
Definition at line 195 of file Profiling.cpp.
References ProfilerImpl::m_ProfilingEnabled.
void EndEvent | ( | Event * | event | ) |
Definition at line 229 of file Profiling.cpp.
References ARMNN_ASSERT, Event::GetParentEvent(), armnn::IgnoreUnused(), and ProfilerImpl::m_Parents.
std::uint32_t GetEventColor | ( | const BackendId & | backendId | ) | const |
bool IsProfilingEnabled | ( | ) |
Definition at line 190 of file Profiling.cpp.
References ProfilerImpl::m_ProfilingEnabled.
void PopulateDescendants | ( | std::map< const Event *, std::vector< const Event * >> & | outDescendantsMap | ) | const |
Definition at line 271 of file Profiling.cpp.
References Event::GetParentEvent(), and ProfilerImpl::m_EventSequence.
Referenced by ProfilerImpl::AnalyzeEventsAndWriteResults(), and ProfilerImpl::Print().
void PopulateParent | ( | std::vector< const Event * > & | outEvents, |
int & | outBaseLevel, | ||
std::string | parentName | ||
) | const |
Definition at line 257 of file Profiling.cpp.
References armnn::CalcLevel(), Event::GetName(), and ProfilerImpl::m_EventSequence.
Referenced by ProfilerImpl::AnalyzeEventsAndWriteResults(), and ProfilerImpl::Print().
void Print | ( | std::ostream & | outStream | ) | const |
Definition at line 381 of file Profiling.cpp.
References armnn::DetailsOnly, armnn::DetailsWithEvents, JsonChildObject::EnableDetailsOnly(), armnn::ExecObjectDesc, armnn::ExtractJsonObjects(), ProfilerImpl::m_DetailsToStdOutMethod, ProfilerImpl::m_ProfilingDetails, ProfilerImpl::PopulateDescendants(), ProfilerImpl::PopulateParent(), JsonUtils::PrintArmNNHeader(), JsonUtils::PrintFooter(), JsonUtils::PrintHeader(), JsonPrinter::PrintJsonChildObject(), JsonUtils::PrintNewLine(), and JsonUtils::PrintSeparator().
Referenced by ProfilerImpl::~ProfilerImpl().
void UpdateEventTag | ( | ) |
ProfilingDetailsMethod m_DetailsToStdOutMethod |
Definition at line 105 of file Profiling.hpp.
Referenced by ProfilerImpl::EnableNetworkDetailsToStdOut(), and ProfilerImpl::Print().
std::vector<EventPtr> m_EventSequence |
Definition at line 102 of file Profiling.hpp.
Referenced by ProfilerImpl::AnalyzeEventsAndWriteResults(), ProfilerImpl::BeginEvent(), ProfilerImpl::CalculateProfilingEventStats(), ProfilerImpl::PopulateDescendants(), ProfilerImpl::PopulateParent(), and ProfilerImpl::ProfilerImpl().
std::stack<Event*> m_Parents |
Definition at line 101 of file Profiling.hpp.
Referenced by ProfilerImpl::AnalyzeEventsAndWriteResults(), ProfilerImpl::BeginEvent(), and ProfilerImpl::EndEvent().
DescPtr m_ProfilingDetails = std::make_unique<ProfilingDetails>() |
Definition at line 103 of file Profiling.hpp.
Referenced by ProfilerImpl::AddLayerDetails(), and ProfilerImpl::Print().
bool m_ProfilingEnabled |
Definition at line 104 of file Profiling.hpp.
Referenced by ProfilerImpl::EnableProfiling(), ProfilerImpl::IsProfilingEnabled(), and ProfilerImpl::~ProfilerImpl().