ArmNN  NotReleased
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 std::string &name, Args... args)
 
 ~ScopedProfilingEvent ()
 

Detailed Description

Definition at line 113 of file Profiling.hpp.

Member Typedef Documentation

◆ InstrumentPtr

using InstrumentPtr = std::unique_ptr<Instrument>

Definition at line 116 of file Profiling.hpp.

Constructor & Destructor Documentation

◆ ScopedProfilingEvent()

ScopedProfilingEvent ( const BackendId backendId,
const std::string &  name,
Args...  args 
)
inline

Definition at line 119 of file Profiling.hpp.

120  : m_Event(nullptr)
121  , m_Profiler(ProfilerManager::GetInstance().GetProfiler())
122  {
123  if (m_Profiler && m_Profiler->IsProfilingEnabled())
124  {
125  std::vector<InstrumentPtr> instruments(0);
126  instruments.reserve(sizeof...(args)); //One allocation
127  ConstructNextInVector(instruments, args...);
128  m_Event = m_Profiler->BeginEvent(backendId, name, std::move(instruments));
129  }
130  }
Event * BeginEvent(const BackendId &backendId, const std::string &name, std::vector< InstrumentPtr > &&instruments)
Definition: Profiling.cpp:200
static ProfilerManager & GetInstance()
Definition: Profiling.cpp:486
bool IsProfilingEnabled() override
Definition: Profiling.cpp:190

◆ ~ScopedProfilingEvent()

~ScopedProfilingEvent ( )
inline

Definition at line 132 of file Profiling.hpp.

133  {
134  if (m_Profiler && m_Event)
135  {
136  m_Profiler->EndEvent(m_Event);
137  }
138  }
void EndEvent(Event *event)
Definition: Profiling.cpp:217

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