From e155bbf0e9be6b4d7974297585a59207cd89b00a Mon Sep 17 00:00:00 2001 From: Derek Lamberti Date: Wed, 13 Oct 2021 14:32:12 +0100 Subject: Refactor: Profiler moved to Graph * This is to enable later work to instrument the Optimizer. Signed-off-by: Derek Lamberti Change-Id: I2cf1fe022e0d100d6d8705adfbb8cab3ffc96a86 --- src/armnn/Graph.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/armnn/Graph.hpp') diff --git a/src/armnn/Graph.hpp b/src/armnn/Graph.hpp index e2321bb0e4..74aefb23ee 100644 --- a/src/armnn/Graph.hpp +++ b/src/armnn/Graph.hpp @@ -6,6 +6,7 @@ #include "LayersFwd.hpp" #include "IGraphObservable.hpp" +#include "Profiling.hpp" #include #include @@ -96,6 +97,7 @@ public: : m_LayersInOrder(true) , m_ShapeInferenceMethod(shapeInferenceMethod ? ShapeInferenceMethod::InferAndValidate : ShapeInferenceMethod::ValidateOnly) + , m_Profiler(std::make_shared()) {} Graph(const Graph& other); @@ -113,6 +115,7 @@ public: m_OutputIds = std::move(other.m_OutputIds); m_LayersInOrder = std::move(other.m_LayersInOrder); m_Views = std::move(other.m_Views); + m_Profiler = std::move(other.m_Profiler); other.ForEachLayer([this](Layer* otherLayer) { @@ -220,6 +223,8 @@ public: /// Gets the position of a layer in the graph. Iterator GetPosInGraph(Layer& layer); + const std::shared_ptr& GetProfiler() const; + private: template class LayerInGraphBase; @@ -268,6 +273,7 @@ private: std::map> m_Views; ShapeInferenceMethod m_ShapeInferenceMethod; + std::shared_ptr m_Profiler; // Throws exception due to a layer input not being connected to an output slot. /// Also verifies weights and bias are set for FullyConnected layers. -- cgit v1.2.1