IVGCVSW-3030 Refactor code and fix OptimizeSubgraphView
* Refactored the Optimizer code for readibility, in view of
upcoming changes
* Rename one of the ISubgraphViewConverter interface methods to
give it a more meaningful name
* Improved the OptimizationViews class, added comments and
useful funtion overloads
* Fixed an error in the default implementationof the new
OptimizeSubgraphView method in IBackendInternal
Change-Id: I683a56d562aa093bac06f0e83fb13e144ed81485
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
diff --git a/src/backends/backendsCommon/IBackendInternal.hpp b/src/backends/backendsCommon/IBackendInternal.hpp
index 5316f68..3d94d6e 100644
--- a/src/backends/backendsCommon/IBackendInternal.hpp
+++ b/src/backends/backendsCommon/IBackendInternal.hpp
@@ -59,7 +59,7 @@
// @deprecated Use "OptimizationViews OptimizeSubgraphView(const SubgraphView&);" instead.
virtual SubgraphViewUniquePtr OptimizeSubgraphView(const SubgraphView& subgraph, bool& optimizationAttempted) const
{
- optimizationAttempted=false;
+ optimizationAttempted = false;
return nullptr;
}
@@ -67,11 +67,11 @@
// Override this method with a custom optimization implementation.
virtual OptimizationViews OptimizeSubgraphView(const SubgraphView& subgraph) const
{
- bool attempted=false;
- SubgraphViewUniquePtr optSubgraph = OptimizeSubgraphView(subgraph, attempted);
+ bool optimizationAttempted = false;
+ SubgraphViewUniquePtr optSubgraph = OptimizeSubgraphView(subgraph, optimizationAttempted);
OptimizationViews result;
- if (!attempted)
+ if (!optimizationAttempted)
{
result.AddUntouchedSubgraph(SubgraphView(subgraph));
}
@@ -79,7 +79,7 @@
{
if (optSubgraph)
{
- result.AddSubstituion({*optSubgraph.get(), subgraph});
+ result.AddSubstituion({subgraph, SubgraphView(*optSubgraph.get())});
}
else
{