From ff05cc50880032614675e9422ba829785f61ba14 Mon Sep 17 00:00:00 2001 From: Derek Lamberti Date: Fri, 26 Apr 2019 13:05:17 +0100 Subject: IVGCVSW-2405 Rename SubGraph to SubgraphView Change-Id: Ie50aeccf053c20c3a01a75042bbc3acd824375af Signed-off-by: Derek Lamberti Signed-off-by: Matteo Martincigh --- src/armnn/SubgraphViewSelector.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/armnn/SubgraphViewSelector.hpp (limited to 'src/armnn/SubgraphViewSelector.hpp') diff --git a/src/armnn/SubgraphViewSelector.hpp b/src/armnn/SubgraphViewSelector.hpp new file mode 100644 index 0000000000..9d881faa7c --- /dev/null +++ b/src/armnn/SubgraphViewSelector.hpp @@ -0,0 +1,38 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// +#pragma once + +#include "SubgraphView.hpp" +#include +#include + +namespace armnn +{ + +class Layer; +class Graph; + +class SubgraphViewSelector final +{ +public: + using SubgraphViewPtr = std::unique_ptr; + using Subgraphs = std::vector; + using LayerSelectorFunction = std::function; + + /// Selects subgraphs from a graph based on the selector function and the algorithm. + /// Since the Subgraphs object returns modifiable pointers to the input and output slots of the graph: + /// 1) the graph/sub-graph cannot be const + /// 2) the caller needs to make sure that the Subgraphs lifetime is shorter than the parent graph's + static Subgraphs SelectSubgraphs(Graph& graph, const LayerSelectorFunction& selector); + static Subgraphs SelectSubgraphs(SubgraphView& subgraph, const LayerSelectorFunction& selector); + +private: + // this is a utility class, don't construct or copy + SubgraphViewSelector() = delete; + SubgraphViewSelector(const SubgraphViewSelector&) = delete; + SubgraphViewSelector & operator=(const SubgraphViewSelector&) = delete; +}; + +} // namespace armnn -- cgit v1.2.1