ArmNN
 20.05
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 112 of file Profiling.hpp.

Member Typedef Documentation

◆ InstrumentPtr

using InstrumentPtr = std::unique_ptr<Instrument>

Definition at line 115 of file Profiling.hpp.

Constructor & Destructor Documentation

◆ ScopedProfilingEvent()

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

Definition at line 118 of file Profiling.hpp.

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

◆ ~ScopedProfilingEvent()

~ScopedProfilingEvent ( )
inline

Definition at line 131 of file Profiling.hpp.

References armnn::IgnoreUnused().

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

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