aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/Graph.hpp
diff options
context:
space:
mode:
authorDerek Lamberti <derek.lamberti@arm.com>2021-10-13 14:32:12 +0100
committerDerek Lamberti <derek.lamberti@arm.com>2021-10-15 15:29:43 +0100
commite155bbf0e9be6b4d7974297585a59207cd89b00a (patch)
tree78f5d5f4f2a3a8551854fdd46eac7f599e371bd1 /src/armnn/Graph.hpp
parent827e4bf519ec1e4af2fb0b32d476b8b1c73b877c (diff)
downloadarmnn-e155bbf0e9be6b4d7974297585a59207cd89b00a.tar.gz
Refactor: Profiler moved to Graph
* This is to enable later work to instrument the Optimizer. Signed-off-by: Derek Lamberti <derek.lamberti@arm.com> Change-Id: I2cf1fe022e0d100d6d8705adfbb8cab3ffc96a86
Diffstat (limited to 'src/armnn/Graph.hpp')
-rw-r--r--src/armnn/Graph.hpp6
1 files changed, 6 insertions, 0 deletions
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 <armnn/Types.hpp>
#include <armnn/TensorFwd.hpp>
@@ -96,6 +97,7 @@ public:
: m_LayersInOrder(true)
, m_ShapeInferenceMethod(shapeInferenceMethod ? ShapeInferenceMethod::InferAndValidate :
ShapeInferenceMethod::ValidateOnly)
+ , m_Profiler(std::make_shared<IProfiler>())
{}
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<IProfiler>& GetProfiler() const;
+
private:
template <typename LayerT>
class LayerInGraphBase;
@@ -268,6 +273,7 @@ private:
std::map<const GraphEvent, std::list<IGraphObservable*>> m_Views;
ShapeInferenceMethod m_ShapeInferenceMethod;
+ std::shared_ptr<IProfiler> 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.