ArmNN
 21.02
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 110 of file Profiling.hpp.

Member Typedef Documentation

◆ InstrumentPtr

using InstrumentPtr = std::unique_ptr<Instrument>

Definition at line 113 of file Profiling.hpp.

Constructor & Destructor Documentation

◆ ScopedProfilingEvent()

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

Definition at line 116 of file Profiling.hpp.

117  : m_Event(nullptr)
118  , m_Profiler(ProfilerManager::GetInstance().GetProfiler())
119  {
120  if (m_Profiler && m_Profiler->IsProfilingEnabled())
121  {
122  std::vector<InstrumentPtr> instruments(0);
123  instruments.reserve(sizeof...(args)); //One allocation
124  ConstructNextInVector(instruments, std::forward<Args>(args)...);
125  m_Event = m_Profiler->BeginEvent(backendId, name, std::move(instruments));
126  }
127  }
static ProfilerManager & GetInstance()
Definition: Profiling.cpp:489
bool IsProfilingEnabled()
Checks whether profiling is enabled.
Definition: Profiling.cpp:512

◆ ~ScopedProfilingEvent()

~ScopedProfilingEvent ( )
inline

Definition at line 129 of file Profiling.hpp.

References armnn::IgnoreUnused().

130  {
131  if (m_Profiler && m_Event)
132  {
133  m_Profiler->pProfilerImpl->EndEvent(m_Event);
134  }
135  }

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