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/backends/README.md | 6 +++--- src/backends/backendsCommon/IBackendInternal.hpp | 14 ++++++++------ src/backends/cl/ClBackend.cpp | 12 ++++++------ src/backends/cl/ClBackend.hpp | 8 ++++---- src/backends/neon/NeonBackend.cpp | 12 ++++++------ src/backends/neon/NeonBackend.hpp | 8 ++++---- src/backends/reference/RefBackend.cpp | 12 ++++++------ src/backends/reference/RefBackend.hpp | 8 ++++---- 8 files changed, 41 insertions(+), 39 deletions(-) (limited to 'src/backends') diff --git a/src/backends/README.md b/src/backends/README.md index c269ea08da..90eeed2968 100644 --- a/src/backends/README.md +++ b/src/backends/README.md @@ -116,11 +116,11 @@ The interface functions to be implemented are: virtual IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const = 0; virtual Optimizations GetOptimizations() const = 0; virtual ILayerSupportSharedPtr GetLayerSupport() const = 0; - virtual SubGraphUniquePtr OptimizeSubGraph(const SubGraph& subGraph, bool& optimizationAttempted) const = 0; + virtual SubgraphUniquePtr OptimizeSubgraph(const SubgraphView& subgraph, bool& optimizationAttempted) const = 0; ``` Note that ```GetOptimizations()``` has been deprecated. -The method ```OptimizeSubGraph(...)``` should be used instead to specific optimizations to a given sub-graph. +The method ```OptimizeSubgraph(...)``` should be used instead to specific optimizations to a given sub-graph. The ArmNN framework then creates instances of the IBackendInternal interface with the help of the [BackendRegistry](backendsCommon/BackendRegistry.hpp) singleton. @@ -191,7 +191,7 @@ mechanism: ## The Optimizations The backends may choose to implement backend-specific optimizations. -This is supported through the method ```OptimizeSubGraph(...)``` to the backend interface +This is supported through the method ```OptimizeSubgraph(...)``` to the backend interface that allows the backends to apply their specific optimizations to a given sub-grah. The way backends had to provide a list optimizations to the Optimizer (through the ```GetOptimizations()``` method) diff --git a/src/backends/backendsCommon/IBackendInternal.hpp b/src/backends/backendsCommon/IBackendInternal.hpp index 6e6d47fc90..108e66e6a8 100644 --- a/src/backends/backendsCommon/IBackendInternal.hpp +++ b/src/backends/backendsCommon/IBackendInternal.hpp @@ -7,8 +7,8 @@ #include #include -#include -#include +#include +#include #include @@ -41,9 +41,9 @@ public: using IMemoryManagerUniquePtr = std::unique_ptr; using IMemoryManagerSharedPtr = std::shared_ptr; - using ISubGraphConverterPtr = std::unique_ptr; + using ISubgraphViewConverterPtr = std::unique_ptr; - using SubGraphUniquePtr = std::unique_ptr; + using SubgraphViewUniquePtr = std::unique_ptr; virtual IMemoryManagerUniquePtr CreateMemoryManager() const = 0; @@ -52,12 +52,14 @@ public: virtual IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const = 0; - virtual ISubGraphConverterPtr CreateSubGraphConverter(const std::shared_ptr& subGraph) const = 0; + virtual ISubgraphViewConverterPtr CreateSubgraphViewConverter(const std::shared_ptr& subgraph) + const = 0; virtual Optimizations GetOptimizations() const = 0; virtual ILayerSupportSharedPtr GetLayerSupport() const = 0; - virtual SubGraphUniquePtr OptimizeSubGraph(const SubGraph& subGraph, bool& optimizationAttempted) const = 0; + virtual SubgraphViewUniquePtr OptimizeSubgraphView(const SubgraphView& subgraph, bool& optimizationAttempted) + const = 0; }; using IBackendInternalUniquePtr = std::unique_ptr; diff --git a/src/backends/cl/ClBackend.cpp b/src/backends/cl/ClBackend.cpp index dfa5e7c777..25318ecdaa 100644 --- a/src/backends/cl/ClBackend.cpp +++ b/src/backends/cl/ClBackend.cpp @@ -63,10 +63,10 @@ ClBackend::CreateBackendContext(const IRuntime::CreationOptions& options) const return IBackendContextPtr{new ClBackendContext{options}}; } -IBackendInternal::ISubGraphConverterPtr ClBackend::CreateSubGraphConverter( - const std::shared_ptr& subGraph) const +IBackendInternal::ISubgraphViewConverterPtr ClBackend::CreateSubgraphViewConverter( + const std::shared_ptr& subgraph) const { - return ISubGraphConverterPtr{}; + return ISubgraphViewConverterPtr{}; } IBackendInternal::Optimizations ClBackend::GetOptimizations() const @@ -80,13 +80,13 @@ IBackendInternal::ILayerSupportSharedPtr ClBackend::GetLayerSupport() const return layerSupport; } -IBackendInternal::SubGraphUniquePtr ClBackend::OptimizeSubGraph(const SubGraph& subGraph, - bool& optimizationAttempted) const +IBackendInternal::SubgraphViewUniquePtr ClBackend::OptimizeSubgraphView(const SubgraphView& subgraph, + bool& optimizationAttempted) const { // Not trying to optimize the given sub-graph optimizationAttempted = false; - return SubGraphUniquePtr{}; + return SubgraphViewUniquePtr{}; } } // namespace armnn diff --git a/src/backends/cl/ClBackend.hpp b/src/backends/cl/ClBackend.hpp index 8133ce49f6..e50c7e12ca 100644 --- a/src/backends/cl/ClBackend.hpp +++ b/src/backends/cl/ClBackend.hpp @@ -25,14 +25,14 @@ public: IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const override; - IBackendInternal::ISubGraphConverterPtr CreateSubGraphConverter( - const std::shared_ptr& subGraph) const override; + IBackendInternal::ISubgraphViewConverterPtr CreateSubgraphViewConverter( + const std::shared_ptr& subgraph) const override; IBackendInternal::Optimizations GetOptimizations() const override; IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override; - IBackendInternal::SubGraphUniquePtr OptimizeSubGraph(const SubGraph& subGraph, - bool& optimizationAttempted) const override; + IBackendInternal::SubgraphViewUniquePtr OptimizeSubgraphView(const SubgraphView& subgraph, + bool& optimizationAttempted) const override; }; } // namespace armnn diff --git a/src/backends/neon/NeonBackend.cpp b/src/backends/neon/NeonBackend.cpp index 830d637b01..096fe26642 100644 --- a/src/backends/neon/NeonBackend.cpp +++ b/src/backends/neon/NeonBackend.cpp @@ -63,10 +63,10 @@ IBackendInternal::IBackendContextPtr NeonBackend::CreateBackendContext(const IRu return IBackendContextPtr{}; } -IBackendInternal::ISubGraphConverterPtr NeonBackend::CreateSubGraphConverter( - const std::shared_ptr& subGraph) const +IBackendInternal::ISubgraphViewConverterPtr NeonBackend::CreateSubgraphViewConverter( + const std::shared_ptr& subgraph) const { - return ISubGraphConverterPtr{}; + return ISubgraphViewConverterPtr{}; } IBackendInternal::Optimizations NeonBackend::GetOptimizations() const @@ -80,13 +80,13 @@ IBackendInternal::ILayerSupportSharedPtr NeonBackend::GetLayerSupport() const return layerSupport; } -IBackendInternal::SubGraphUniquePtr NeonBackend::OptimizeSubGraph(const SubGraph& subGraph, - bool& optimizationAttempted) const +IBackendInternal::SubgraphViewUniquePtr NeonBackend::OptimizeSubgraphView(const SubgraphView& subgraph, + bool& optimizationAttempted) const { // Not trying to optimize the given sub-graph optimizationAttempted = false; - return SubGraphUniquePtr{}; + return SubgraphViewUniquePtr{}; } } // namespace armnn diff --git a/src/backends/neon/NeonBackend.hpp b/src/backends/neon/NeonBackend.hpp index 634704571c..a2949b1e14 100644 --- a/src/backends/neon/NeonBackend.hpp +++ b/src/backends/neon/NeonBackend.hpp @@ -25,14 +25,14 @@ public: IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const override; - IBackendInternal::ISubGraphConverterPtr CreateSubGraphConverter( - const std::shared_ptr& subGraph) const override; + IBackendInternal::ISubgraphViewConverterPtr CreateSubgraphViewConverter( + const std::shared_ptr& subgraph) const override; IBackendInternal::Optimizations GetOptimizations() const override; IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override; - IBackendInternal::SubGraphUniquePtr OptimizeSubGraph(const SubGraph& subGraph, - bool& optimizationAttempted) const override; + IBackendInternal::SubgraphViewUniquePtr OptimizeSubgraphView(const SubgraphView& subgraph, + bool& optimizationAttempted) const override; }; } // namespace armnn diff --git a/src/backends/reference/RefBackend.cpp b/src/backends/reference/RefBackend.cpp index d5f5348642..006f2e7af9 100644 --- a/src/backends/reference/RefBackend.cpp +++ b/src/backends/reference/RefBackend.cpp @@ -56,10 +56,10 @@ IBackendInternal::IMemoryManagerUniquePtr RefBackend::CreateMemoryManager() cons return IMemoryManagerUniquePtr{}; } -IBackendInternal::ISubGraphConverterPtr RefBackend::CreateSubGraphConverter( - const std::shared_ptr& subGraph) const +IBackendInternal::ISubgraphViewConverterPtr RefBackend::CreateSubgraphViewConverter( + const std::shared_ptr& subgraph) const { - return ISubGraphConverterPtr{}; + return ISubgraphViewConverterPtr{}; } IBackendInternal::Optimizations RefBackend::GetOptimizations() const @@ -73,13 +73,13 @@ IBackendInternal::ILayerSupportSharedPtr RefBackend::GetLayerSupport() const return layerSupport; } -IBackendInternal::SubGraphUniquePtr RefBackend::OptimizeSubGraph(const SubGraph& subGraph, - bool& optimizationAttempted) const +IBackendInternal::SubgraphViewUniquePtr RefBackend::OptimizeSubgraphView(const SubgraphView& subgraph, + bool& optimizationAttempted) const { // Not trying to optimize the given sub-graph optimizationAttempted = false; - return SubGraphUniquePtr{}; + return SubgraphViewUniquePtr{}; } } // namespace armnn diff --git a/src/backends/reference/RefBackend.hpp b/src/backends/reference/RefBackend.hpp index 6305bf568c..8658e1a87e 100644 --- a/src/backends/reference/RefBackend.hpp +++ b/src/backends/reference/RefBackend.hpp @@ -25,14 +25,14 @@ public: IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const override; - IBackendInternal::ISubGraphConverterPtr CreateSubGraphConverter( - const std::shared_ptr& subGraph) const override; + IBackendInternal::ISubgraphViewConverterPtr CreateSubgraphViewConverter( + const std::shared_ptr& subgraph) const override; IBackendInternal::Optimizations GetOptimizations() const override; IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override; - IBackendInternal::SubGraphUniquePtr OptimizeSubGraph(const SubGraph& subGraph, - bool& optimizationAttempted) const override; + IBackendInternal::SubgraphViewUniquePtr OptimizeSubgraphView(const SubgraphView& subgraph, + bool& optimizationAttempted) const override; }; } // namespace armnn -- cgit v1.2.1