From e22899f8139b2625121a61608e79a26ed2d1aa1c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=ED=95=9C=EC=A2=85/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84?= =?utf8?q?=EC=9E=90?= Date: Fri, 12 Oct 2018 12:36:04 +0900 Subject: [PATCH] [neurun] Rename IBackendConfig to IConfig (#3098) Rename `IBackendConfig` to `IConfig` since it is in namespace `neurun::backend` so "Backend" in the class name is redundant. Signed-off-by: Hanjoung Lee --- runtimes/neurun/src/backend/BackendManager.cc | 12 ++++++------ runtimes/neurun/src/backend/BackendManager.h | 8 ++++---- .../src/backend/acl_cl/{BackendConfig.cc => Config.cc} | 4 ++-- .../neurun/src/backend/acl_cl/{BackendConfig.h => Config.h} | 12 ++++++------ .../neurun/src/backend/cpu/{BackendConfig.cc => Config.cc} | 4 ++-- .../neurun/src/backend/cpu/{BackendConfig.h => Config.h} | 12 ++++++------ runtimes/neurun/src/backend/cpu/StageGenerator.cc | 2 +- .../src/backend/interface/{IBackendConfig.h => IConfig.h} | 10 +++++----- runtimes/neurun/src/dumper/dot/DotNodeInfo.cc | 2 +- runtimes/neurun/src/graph/Graph.cc | 2 +- runtimes/neurun/src/graph/pass/PermutationInsertionPass.cc | 2 +- 11 files changed, 35 insertions(+), 35 deletions(-) rename runtimes/neurun/src/backend/acl_cl/{BackendConfig.cc => Config.cc} (86%) rename runtimes/neurun/src/backend/acl_cl/{BackendConfig.h => Config.h} (79%) rename runtimes/neurun/src/backend/cpu/{BackendConfig.cc => Config.cc} (91%) rename runtimes/neurun/src/backend/cpu/{BackendConfig.h => Config.h} (79%) rename runtimes/neurun/src/backend/interface/{IBackendConfig.h => IConfig.h} (84%) diff --git a/runtimes/neurun/src/backend/BackendManager.cc b/runtimes/neurun/src/backend/BackendManager.cc index ba85744..f5d8188 100644 --- a/runtimes/neurun/src/backend/BackendManager.cc +++ b/runtimes/neurun/src/backend/BackendManager.cc @@ -16,11 +16,11 @@ #include "BackendManager.h" -#include "backend/acl_cl/BackendConfig.h" +#include "backend/acl_cl/Config.h" #include "backend/acl_cl/TensorBuilder.h" #include "backend/acl_cl/InitializerGenerator.h" #include "backend/acl_cl/StageGenerator.h" -#include "backend/cpu/BackendConfig.h" +#include "backend/cpu/Config.h" #include "backend/cpu/TensorBuilder.h" #include "backend/cpu/InitializerGenerator.h" #include "backend/cpu/StageGenerator.h" @@ -30,7 +30,7 @@ namespace neurun namespace backend { -Backend::Backend(const std::shared_ptr &backend_config, +Backend::Backend(const std::shared_ptr &backend_config, const std::shared_ptr &initializer_gen, const std::shared_ptr &stage_gen) : _config(backend_config), _initializer_gen(initializer_gen), _stage_gen(stage_gen) @@ -38,7 +38,7 @@ Backend::Backend(const std::shared_ptr &backend backend_config->initialize(); } -const std::shared_ptr Backend::config() const { return _config; } +const std::shared_ptr Backend::config() const { return _config; } const std::shared_ptr Backend::initializer_gen() const { @@ -60,7 +60,7 @@ BackendManager::BackendManager(const neurun::graph::operand::Set &operands) // Add arm_compute backend { using namespace ::neurun::backend::acl_cl; - auto acl_backend_initializer = std::make_shared(); + auto acl_backend_initializer = std::make_shared(); auto acl_tensor_builder = std::make_shared(); auto acl_initializer_gen = std::make_shared(operands); auto acl_stage_gen = std::make_shared(operands, acl_tensor_builder); @@ -72,7 +72,7 @@ BackendManager::BackendManager(const neurun::graph::operand::Set &operands) // Add CPU backend { using namespace ::neurun::backend::cpu; - auto cpu_backend_initializer = std::make_shared(); + auto cpu_backend_initializer = std::make_shared(); auto cpu_tensor_builder = std::make_shared(); auto cpu_initializer_gen = std::make_shared(operands); auto cpu_stage_gen = std::make_shared(operands, cpu_tensor_builder); diff --git a/runtimes/neurun/src/backend/BackendManager.h b/runtimes/neurun/src/backend/BackendManager.h index f69b632..50cece9 100644 --- a/runtimes/neurun/src/backend/BackendManager.h +++ b/runtimes/neurun/src/backend/BackendManager.h @@ -27,7 +27,7 @@ namespace neurun namespace backend { -struct IBackendConfig; +struct IConfig; struct IInitializerGenerator; struct IStageGenerator; struct ITensorBuilder; @@ -35,7 +35,7 @@ struct ITensorBuilder; class Backend { public: - Backend(const std::shared_ptr &backend_config, + Backend(const std::shared_ptr &backend_config, const std::shared_ptr &initializer_gen, const std::shared_ptr &stage_gen); @@ -45,13 +45,13 @@ public: } public: - const std::shared_ptr config() const; + const std::shared_ptr config() const; const std::shared_ptr initializer_gen() const; const std::shared_ptr stage_gen() const; const std::shared_ptr tensor_builder() const; private: - std::shared_ptr _config; + std::shared_ptr _config; std::shared_ptr _initializer_gen; std::shared_ptr _stage_gen; }; diff --git a/runtimes/neurun/src/backend/acl_cl/BackendConfig.cc b/runtimes/neurun/src/backend/acl_cl/Config.cc similarity index 86% rename from runtimes/neurun/src/backend/acl_cl/BackendConfig.cc rename to runtimes/neurun/src/backend/acl_cl/Config.cc index 6b3e6b3..cad9b89 100644 --- a/runtimes/neurun/src/backend/acl_cl/BackendConfig.cc +++ b/runtimes/neurun/src/backend/acl_cl/Config.cc @@ -16,7 +16,7 @@ #include -#include "backend/acl_cl/BackendConfig.h" +#include "backend/acl_cl/Config.h" namespace neurun { @@ -25,7 +25,7 @@ namespace backend namespace acl_cl { -void BackendConfig::initialize() { arm_compute::CLScheduler::get().default_init(); } +void Config::initialize() { arm_compute::CLScheduler::get().default_init(); } } // namespace acl_cl } // namespace backend diff --git a/runtimes/neurun/src/backend/acl_cl/BackendConfig.h b/runtimes/neurun/src/backend/acl_cl/Config.h similarity index 79% rename from runtimes/neurun/src/backend/acl_cl/BackendConfig.h rename to runtimes/neurun/src/backend/acl_cl/Config.h index 87ba214..d080881 100644 --- a/runtimes/neurun/src/backend/acl_cl/BackendConfig.h +++ b/runtimes/neurun/src/backend/acl_cl/Config.h @@ -14,10 +14,10 @@ * limitations under the License. */ -#ifndef __NEURUN_BACKEND_ACL_CL_BACKEND_CONFIG_H__ -#define __NEURUN_BACKEND_ACL_CL_BACKEND_CONFIG_H__ +#ifndef __NEURUN_BACKEND_ACL_CL_CONFIG_H__ +#define __NEURUN_BACKEND_ACL_CL_CONFIG_H__ -#include "backend/interface/IBackendConfig.h" +#include "backend/interface/IConfig.h" namespace neurun { @@ -26,10 +26,10 @@ namespace backend namespace acl_cl { -class BackendConfig : public IBackendConfig +class Config : public IConfig { public: - BackendConfig() + Config() { // DO NOTHING } @@ -43,4 +43,4 @@ public: } // namespace backend } // namespace neurun -#endif // __NEURUN_BACKEND_ACL_CL_BACKEND_CONFIG_H__ +#endif // __NEURUN_BACKEND_ACL_CL_CONFIG_H__ diff --git a/runtimes/neurun/src/backend/cpu/BackendConfig.cc b/runtimes/neurun/src/backend/cpu/Config.cc similarity index 91% rename from runtimes/neurun/src/backend/cpu/BackendConfig.cc rename to runtimes/neurun/src/backend/cpu/Config.cc index 34fc349..001ba9d 100644 --- a/runtimes/neurun/src/backend/cpu/BackendConfig.cc +++ b/runtimes/neurun/src/backend/cpu/Config.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "backend/cpu/BackendConfig.h" +#include "backend/cpu/Config.h" namespace neurun { @@ -23,7 +23,7 @@ namespace backend namespace cpu { -void BackendConfig::initialize() +void Config::initialize() { // DO NOTHING } diff --git a/runtimes/neurun/src/backend/cpu/BackendConfig.h b/runtimes/neurun/src/backend/cpu/Config.h similarity index 79% rename from runtimes/neurun/src/backend/cpu/BackendConfig.h rename to runtimes/neurun/src/backend/cpu/Config.h index 5d2c36e..e4d35fe 100644 --- a/runtimes/neurun/src/backend/cpu/BackendConfig.h +++ b/runtimes/neurun/src/backend/cpu/Config.h @@ -14,10 +14,10 @@ * limitations under the License. */ -#ifndef __NEURUN_BACKEND_CPU_BACKEND_CONFIG_H__ -#define __NEURUN_BACKEND_CPU_BACKEND_CONFIG_H__ +#ifndef __NEURUN_BACKEND_CPU_CONFIG_H__ +#define __NEURUN_BACKEND_CPU_CONFIG_H__ -#include "backend/interface/IBackendConfig.h" +#include "backend/interface/IConfig.h" namespace neurun { @@ -26,10 +26,10 @@ namespace backend namespace cpu { -class BackendConfig : public IBackendConfig +class Config : public IConfig { public: - BackendConfig() + Config() { // DO NOTHING } @@ -43,4 +43,4 @@ public: } // namespace backend } // namespace neurun -#endif // __NEURUN_BACKEND_CPU_BACKEND_CONFIG_H__ +#endif // __NEURUN_BACKEND_CPU_CONFIG_H__ diff --git a/runtimes/neurun/src/backend/cpu/StageGenerator.cc b/runtimes/neurun/src/backend/cpu/StageGenerator.cc index 40c4c9c..ed7fcdb 100644 --- a/runtimes/neurun/src/backend/cpu/StageGenerator.cc +++ b/runtimes/neurun/src/backend/cpu/StageGenerator.cc @@ -30,7 +30,7 @@ #include "kernel/cpu/SoftMaxLayer.h" #include "kernel/cpu/PermuteLayer.h" #include "backend/BackendManager.h" -#include "backend/interface/IBackendConfig.h" +#include "backend/interface/IConfig.h" #include "logging.h" diff --git a/runtimes/neurun/src/backend/interface/IBackendConfig.h b/runtimes/neurun/src/backend/interface/IConfig.h similarity index 84% rename from runtimes/neurun/src/backend/interface/IBackendConfig.h rename to runtimes/neurun/src/backend/interface/IConfig.h index a5f5aed..1443057 100644 --- a/runtimes/neurun/src/backend/interface/IBackendConfig.h +++ b/runtimes/neurun/src/backend/interface/IConfig.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __INTERNAL_IBACKEND_CONFIG_H__ -#define __INTERNAL_IBACKEND_CONFIG_H__ +#ifndef __NEURUN_BACKEND_ICONFIG_H__ +#define __NEURUN_BACKEND_ICONFIG_H__ #include @@ -26,9 +26,9 @@ namespace neurun namespace backend { -struct IBackendConfig +struct IConfig { - virtual ~IBackendConfig() = default; + virtual ~IConfig() = default; virtual std::string id() = 0; virtual void initialize() = 0; @@ -39,4 +39,4 @@ struct IBackendConfig } // namespace backend } // namespace neurun -#endif // __INTERNAL_IBACKEND_CONFIG_H__ +#endif // __NEURUN_BACKEND_ICONFIG_H__ diff --git a/runtimes/neurun/src/dumper/dot/DotNodeInfo.cc b/runtimes/neurun/src/dumper/dot/DotNodeInfo.cc index f39321e..67ee911 100644 --- a/runtimes/neurun/src/dumper/dot/DotNodeInfo.cc +++ b/runtimes/neurun/src/dumper/dot/DotNodeInfo.cc @@ -18,7 +18,7 @@ #include "DotNodeInfo.h" #include "graph/operation/LowerInfo.h" -#include "backend/interface/IBackendConfig.h" +#include "backend/interface/IConfig.h" namespace neurun { diff --git a/runtimes/neurun/src/graph/Graph.cc b/runtimes/neurun/src/graph/Graph.cc index c89a31d..3f9da84 100644 --- a/runtimes/neurun/src/graph/Graph.cc +++ b/runtimes/neurun/src/graph/Graph.cc @@ -27,7 +27,7 @@ #include "operand/LowerInfo.h" #include "operand/Shape4DConvert.h" #include "codegen/BackendResolver.h" -#include "backend/interface/IBackendConfig.h" +#include "backend/interface/IConfig.h" #include "operation/Permute.h" #include "pass/PermutationInsertionPass.h" diff --git a/runtimes/neurun/src/graph/pass/PermutationInsertionPass.cc b/runtimes/neurun/src/graph/pass/PermutationInsertionPass.cc index dc8e067..17100e3 100644 --- a/runtimes/neurun/src/graph/pass/PermutationInsertionPass.cc +++ b/runtimes/neurun/src/graph/pass/PermutationInsertionPass.cc @@ -23,7 +23,7 @@ #include "graph/operand/Object.h" #include "graph/operation/LowerInfo.h" #include "graph/Graph.h" -#include "backend/interface/IBackendConfig.h" +#include "backend/interface/IConfig.h" #include "logging.h" namespace neurun -- 2.7.4