ArmNN
 22.05.01
IProfiler Class Reference

#include <IProfiler.hpp>

Public Member Functions

void EnableProfiling (bool enableProfiling)
 Enables/disables profiling for this profiler. More...
 
bool IsProfilingEnabled ()
 Checks whether profiling is enabled. More...
 
void AnalyzeEventsAndWriteResults (std::ostream &outStream) const
 Analyzes the tracked events and writes the results to the given output stream. More...
 
void Print (std::ostream &outStream) const
 Print stats for events in JSON Format to the given output stream. More...
 
void EnableNetworkDetailsToStdOut (ProfilingDetailsMethod detailsMethod)
 Print out details of each layer within the network that possesses a descriptor. More...
 
 ~IProfiler ()
 
 IProfiler ()
 

Friends

class ScopedProfilingEvent
 
template<typename DescriptorType >
void ProfilingUpdateDescriptions (const std::string &name, const DescriptorType &desc, const WorkloadInfo &infos, const arm::pipe::ProfilingGuid guid)
 
size_t GetProfilerEventSequenceSize (armnn::IProfiler *profiler)
 

Detailed Description

Definition at line 21 of file IProfiler.hpp.

Constructor & Destructor Documentation

◆ ~IProfiler()

~IProfiler ( )
default

Referenced by IProfiler::Print().

◆ IProfiler()

IProfiler ( )

Definition at line 623 of file Profiling.cpp.

623  : pProfilerImpl(new ProfilerImpl())
624 {};

Member Function Documentation

◆ AnalyzeEventsAndWriteResults()

void AnalyzeEventsAndWriteResults ( std::ostream &  outStream) const

Analyzes the tracked events and writes the results to the given output stream.

Please refer to the configuration variables in Profiling.cpp to customize the information written.

Parameters
[out]outStreamThe stream where to write the profiling results to.

Definition at line 604 of file Profiling.cpp.

Referenced by TEST_SUITE().

605 {
606  pProfilerImpl->AnalyzeEventsAndWriteResults(outStream);
607 }

◆ EnableNetworkDetailsToStdOut()

void EnableNetworkDetailsToStdOut ( ProfilingDetailsMethod  detailsMethod)

Print out details of each layer within the network that possesses a descriptor.

Also outputs tensor info. This will be part of the profiling json output

Definition at line 594 of file Profiling.cpp.

595 {
596  pProfilerImpl->EnableNetworkDetailsToStdOut(detailsMethod);
597 }

◆ EnableProfiling()

void EnableProfiling ( bool  enableProfiling)

Enables/disables profiling for this profiler.

Parameters
[in]enableProfilingA flag that indicates whether profiling should be enabled or not.

Definition at line 589 of file Profiling.cpp.

590 {
591  pProfilerImpl->EnableProfiling(enableProfiling);
592 }

◆ IsProfilingEnabled()

bool IsProfilingEnabled ( )

Checks whether profiling is enabled.

Profiling is disabled by default.

Returns
true if profiling is enabled, false otherwise.

Definition at line 599 of file Profiling.cpp.

Referenced by armnn::ProfilingUpdateDescriptions().

600 {
601  return pProfilerImpl->IsProfilingEnabled();
602 }

◆ Print()

void Print ( std::ostream &  outStream) const

Print stats for events in JSON Format to the given output stream.

Parameters
[out]outStreamThe stream where to write the profiling results to.

Definition at line 609 of file Profiling.cpp.

References IProfiler::~IProfiler().

Referenced by TEST_SUITE().

610 {
611  pProfilerImpl->Print(outStream);
612 }

Friends And Related Function Documentation

◆ GetProfilerEventSequenceSize

size_t GetProfilerEventSequenceSize ( armnn::IProfiler profiler)
friend

Definition at line 19 of file ProfilerTests.cpp.

20 {
21  if (!profiler)
22  {
23  return static_cast<size_t>(-1);
24  }
25 
26  return profiler->pProfilerImpl->m_EventSequence.size();
27 }

◆ ProfilingUpdateDescriptions

void ProfilingUpdateDescriptions ( const std::string &  name,
const DescriptorType &  desc,
const WorkloadInfo infos,
const arm::pipe::ProfilingGuid  guid 
)
friend

< Profiler used

Definition at line 180 of file Profiling.hpp.

184 {
185  IProfiler* profiler(ProfilerManager::GetInstance().GetProfiler()); ///< Profiler used
186  if (profiler && profiler->IsProfilingEnabled())
187  {
188  profiler->AddLayerDetails(name, desc, infos, guid);
189  }
190 }
static ProfilerManager & GetInstance()
Definition: Profiling.cpp:572

◆ ScopedProfilingEvent

friend class ScopedProfilingEvent
friend

Definition at line 66 of file IProfiler.hpp.


The documentation for this class was generated from the following files: