ArmNN
 21.05
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...
 
 ~IProfiler ()
 
 IProfiler ()
 

Friends

class ScopedProfilingEvent
 
size_t GetProfilerEventSequenceSize (armnn::IProfiler *profiler)
 

Detailed Description

Definition at line 19 of file IProfiler.hpp.

Constructor & Destructor Documentation

◆ ~IProfiler()

~IProfiler ( )
default

Referenced by IProfiler::Print().

◆ IProfiler()

IProfiler ( )

Definition at line 535 of file Profiling.cpp.

535 : pProfilerImpl(new ProfilerImpl()) {};

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 517 of file Profiling.cpp.

518 {
519  pProfilerImpl->AnalyzeEventsAndWriteResults(outStream);
520 }

◆ 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 507 of file Profiling.cpp.

508 {
509  pProfilerImpl->EnableProfiling(enableProfiling);
510 }

◆ IsProfilingEnabled()

bool IsProfilingEnabled ( )

Checks whether profiling is enabled.

Profiling is disabled by default.

Returns
true if profiling is enabled, false otherwise.

Definition at line 512 of file Profiling.cpp.

513 {
514  return pProfilerImpl->IsProfilingEnabled();
515 }

◆ 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 522 of file Profiling.cpp.

References IProfiler::~IProfiler().

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().

523 {
524  pProfilerImpl->Print(outStream);
525 }

Friends And Related Function Documentation

◆ GetProfilerEventSequenceSize

size_t GetProfilerEventSequenceSize ( armnn::IProfiler profiler)
friend

Definition at line 22 of file ProfilerTests.cpp.

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

◆ ScopedProfilingEvent

friend class ScopedProfilingEvent
friend

Definition at line 49 of file IProfiler.hpp.


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