diff options
author | keidav01 <keith.davis@arm.com> | 2018-12-11 16:14:20 +0000 |
---|---|---|
committer | Keith Davis Arm <keith.davis@arm.com> | 2018-12-11 17:11:20 +0000 |
commit | 738c2e6a647b886750e1bc3daa6dd615a0244baa (patch) | |
tree | ef88c6a5ee1076471bd36b85c30afb36a68bbfc9 /src/armnn/optimizations | |
parent | 44a7167e0f13dc1d703cd573f57636fde711c618 (diff) | |
download | armnn-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')
-rw-r--r-- | src/armnn/optimizations/AddDebug.hpp | 37 | ||||
-rw-r--r-- | src/armnn/optimizations/All.hpp | 1 |
2 files changed, 38 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 diff --git a/src/armnn/optimizations/All.hpp b/src/armnn/optimizations/All.hpp index a1bff3c5e1..0a6684ee3b 100644 --- a/src/armnn/optimizations/All.hpp +++ b/src/armnn/optimizations/All.hpp @@ -12,3 +12,4 @@ #include "MovePermuteUp.hpp" #include "OptimizeInverseConversions.hpp" #include "ConvertFp32NetworkToFp16.hpp" +#include "AddDebug.hpp" |