From adddddb6cbcb777d92a8c464c9ad0cb9aecc76a3 Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Thu, 24 Jan 2019 14:06:23 +0000 Subject: IVGCVSW-2458 Refactor the Optimize function (Network.cpp) so that subgraphs are optimized by the backends * Added a new method OptimizeSubGraph to the backend interface * Refactored the Optimize function so that the backend-specific optimization is performed by the backend itself (through the new OptimizeSubGraph interface method) * Added a new ApplyBackendOptimizations function to apply the new changes * Added some new convenient constructors to the SubGraph class * Added AddLayer method and a pointer to the parent graph to the SubGraph class * Updated the sub-graph unit tests to match the changes * Added SelectSubGraphs and ReplaceSubGraphConnections overloads that work with sub-graphs * Removed unused code and minor refactoring where necessary Change-Id: I46181794c6a9e3b10558944f804e06a8f693a6d0 --- src/backends/backendsCommon/IBackendInternal.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/backends/backendsCommon/IBackendInternal.hpp') diff --git a/src/backends/backendsCommon/IBackendInternal.hpp b/src/backends/backendsCommon/IBackendInternal.hpp index 2e6b056798..6e6d47fc90 100644 --- a/src/backends/backendsCommon/IBackendInternal.hpp +++ b/src/backends/backendsCommon/IBackendInternal.hpp @@ -43,6 +43,8 @@ public: using ISubGraphConverterPtr = std::unique_ptr; + using SubGraphUniquePtr = std::unique_ptr; + virtual IMemoryManagerUniquePtr CreateMemoryManager() const = 0; virtual IWorkloadFactoryPtr CreateWorkloadFactory( @@ -54,6 +56,8 @@ public: virtual Optimizations GetOptimizations() const = 0; virtual ILayerSupportSharedPtr GetLayerSupport() const = 0; + + virtual SubGraphUniquePtr OptimizeSubGraph(const SubGraph& subGraph, bool& optimizationAttempted) const = 0; }; using IBackendInternalUniquePtr = std::unique_ptr; -- cgit v1.2.1