ArmNN
 21.08
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< profiling::ProfilingGuid > &guid, const std::string &name, Args &&... args)
 
 ~ScopedProfilingEvent ()
 

Detailed Description

Definition at line 129 of file Profiling.hpp.

Member Typedef Documentation

◆ InstrumentPtr

using InstrumentPtr = std::unique_ptr<Instrument>

Definition at line 132 of file Profiling.hpp.

Constructor & Destructor Documentation

◆ ScopedProfilingEvent()

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

Definition at line 135 of file Profiling.hpp.

139  : m_Event(nullptr)
140  , m_Profiler(ProfilerManager::GetInstance().GetProfiler())
141  {
142  if (m_Profiler && m_Profiler->IsProfilingEnabled())
143  {
144  std::vector<InstrumentPtr> instruments(0);
145  instruments.reserve(sizeof...(args)); //One allocation
146  ConstructNextInVector(instruments, std::forward<Args>(args)...);
147  m_Event = m_Profiler->BeginEvent(backendId, name, std::move(instruments), guid);
148  }
149  }
static ProfilerManager & GetInstance()
Definition: Profiling.cpp:526
bool IsProfilingEnabled()
Checks whether profiling is enabled.
Definition: Profiling.cpp:553

◆ ~ScopedProfilingEvent()

~ScopedProfilingEvent ( )
inline

Definition at line 151 of file Profiling.hpp.

References armnn::IgnoreUnused().

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

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