7 #include <common/include/ProfilingGuid.hpp>
40 const std::string& name,
41 std::vector<InstrumentPtr>&& instruments,
44 template<
typename DescriptorType>
46 const DescriptorType& desc,
48 const arm::pipe::ProfilingGuid guid)
73 void Print(std::ostream& outStream)
const;
79 using DescPtr = std::unique_ptr<ProfilingDetails>;
94 template<
typename EventIterType>
98 void PopulateParent(std::vector<const Event*>& outEvents,
int& outBaseLevel, std::string parentName)
const;
135 template<
typename... Args>
138 const std::string& name,
145 std::vector<InstrumentPtr> instruments(0);
146 instruments.reserve(
sizeof...(args));
147 ConstructNextInVector(instruments, std::forward<Args>(args)...);
148 m_Event = m_Profiler->BeginEvent(backendId, name, std::move(instruments), guid);
154 if (m_Profiler && m_Event)
156 m_Profiler->pProfilerImpl->EndEvent(m_Event);
162 void ConstructNextInVector(std::vector<InstrumentPtr>& instruments)
167 template<
typename Arg,
typename... Args>
168 void ConstructNextInVector(std::vector<InstrumentPtr>& instruments, Arg&& arg, Args&&... args)
170 instruments.emplace_back(std::make_unique<Arg>(std::forward<Arg>(arg)));
171 ConstructNextInVector(instruments, std::forward<Args>(args)...);
175 IProfiler* m_Profiler;
179 template<
typename DescriptorType>
181 const DescriptorType& desc,
183 const arm::pipe::ProfilingGuid guid)
188 profiler->AddLayerDetails(name, desc, infos, guid);
192 template<
typename DescriptorType>
193 void IProfiler::AddLayerDetails(
const std::string& name,
194 const DescriptorType& desc,
195 const WorkloadInfo& infos,
196 const arm::pipe::ProfilingGuid guid)
198 return pProfilerImpl->AddLayerDetails(name, desc, infos, guid);
204 #define ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS_UNIQUE_LOC_INNER(lineNumber, backendId, guid, ...) \
205 armnn::ScopedProfilingEvent e_ ## lineNumber(backendId, guid, __VA_ARGS__);
207 #define ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS_UNIQUE_LOC(lineNumber, backendId, guid, ...) \
208 ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS_UNIQUE_LOC_INNER(lineNumber, backendId, guid, __VA_ARGS__)
217 #define ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(backendId, guid, ...) \
218 ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS_UNIQUE_LOC(__LINE__,backendId, guid, __VA_ARGS__)
220 #define ARMNN_SCOPED_PROFILING_EVENT(backendId, name) \
221 ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(backendId, armnn::EmptyOptional(), name, armnn::WallClockTimer())
223 #define ARMNN_SCOPED_PROFILING_EVENT_GUID(backendId, name, guid) \
224 ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(backendId, guid, name, armnn::WallClockTimer())
227 #define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid) \
228 armnn::ProfilingUpdateDescriptions(name, desc, infos, guid);