aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/optimizations/AddDebug.hpp
diff options
context:
space:
mode:
authorkeidav01 <keith.davis@arm.com>2018-12-11 16:14:20 +0000
committerKeith Davis Arm <keith.davis@arm.com>2018-12-11 17:11:20 +0000
commit738c2e6a647b886750e1bc3daa6dd615a0244baa (patch)
treeef88c6a5ee1076471bd36b85c30afb36a68bbfc9 /src/armnn/optimizations/AddDebug.hpp
parent44a7167e0f13dc1d703cd573f57636fde711c618 (diff)
downloadarmnn-738c2e6a647b886750e1bc3daa6dd615a0244baa.tar.gz
IVGCVSW-1434 Add debug mode to Optimizer
* Modified optimizer to support debug mode via DebugLayer Change-Id: Ic8f313778e55540c182cf99876c44a0823be04c6
Diffstat (limited to 'src/armnn/optimizations/AddDebug.hpp')
-rw-r--r--src/armnn/optimizations/AddDebug.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/armnn/optimizations/AddDebug.hpp b/src/armnn/optimizations/AddDebug.hpp
new file mode 100644
index 0000000000..60271b0d77
--- /dev/null
+++ b/src/armnn/optimizations/AddDebug.hpp
@@ -0,0 +1,37 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+#pragma once
+
+#include "Optimization.hpp"
+#include "NetworkUtils.hpp"
+
+namespace armnn
+{
+namespace optimizations
+{
+
+class AddDebugImpl
+{
+public:
+
+ void Run(Graph& graph, Layer& layer) const
+ {
+ if (layer.GetType() != LayerType::Debug && layer.GetType() != LayerType::Output)
+ {
+ // if the inputs/outputs of this layer do not have a debug layer
+ // insert the debug layer after them
+ InsertDebugLayerAfter(graph, layer);
+ }
+ }
+
+protected:
+ AddDebugImpl() = default;
+ ~AddDebugImpl() = default;
+};
+
+using InsertDebugLayer = OptimizeForType<Layer, AddDebugImpl>;
+
+} // namespace optimizations
+} // namespace armnn