ArmNN
 23.11
ScopedProfilingEvent Class Reference

#include <Profiling.hpp>

Public Types

using InstrumentPtr = std::unique_ptr< Instrument >
 

Public Member Functions

template<typename... Args>
 ScopedProfilingEvent (const BackendId &backendId, const Optional< arm::pipe::ProfilingGuid > &guid, const std::string &name, Args &&... args)
 
 ~ScopedProfilingEvent ()
 

Detailed Description

Definition at line 130 of file Profiling.hpp.

Member Typedef Documentation

◆ InstrumentPtr

using InstrumentPtr = std::unique_ptr<Instrument>

Definition at line 133 of file Profiling.hpp.

Constructor & Destructor Documentation

◆ ScopedProfilingEvent()

ScopedProfilingEvent ( const BackendId backendId,
const Optional< arm::pipe::ProfilingGuid > &  guid,
const std::string &  name,
Args &&...  args 
)
inline

Definition at line 136 of file Profiling.hpp.

140  : m_Event(nullptr)
141  , m_Profiler(ProfilerManager::GetInstance().GetProfiler())
142  {
143  if (m_Profiler && m_Profiler->IsProfilingEnabled())
144  {
145  std::vector<InstrumentPtr> instruments(0);
146  instruments.reserve(sizeof...(args)); //One allocation
147  ConstructNextInVector(instruments, std::forward<Args>(args)...);
148  m_Event = m_Profiler->BeginEvent(backendId, name, std::move(instruments), guid);
149  }
150  }

References IProfiler::IsProfilingEnabled().

◆ ~ScopedProfilingEvent()

~ScopedProfilingEvent ( )
inline

Definition at line 152 of file Profiling.hpp.

153  {
154  if (m_Profiler && m_Event)
155  {
156  m_Profiler->pProfilerImpl->EndEvent(m_Event);
157  }
158  }

The documentation for this class was generated from the following file:
armnn::IProfiler::IsProfilingEnabled
bool IsProfilingEnabled()
Checks whether profiling is enabled.
Definition: Profiling.cpp:620
armnn::ProfilerManager::GetInstance
static ProfilerManager & GetInstance()
Definition: Profiling.cpp:593