[neurun] Use forward declaration from a header (#2557)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Mon, 3 Sep 2018 11:28:37 +0000 (20:28 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 3 Sep 2018 11:28:37 +0000 (20:28 +0900)
Forward declare for the interfaces that are used from
`BackendManger.h`.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/src/internal/BackendManager.cc
runtimes/neurun/src/internal/BackendManager.h

index bf5821c..292b751 100644 (file)
 namespace internal
 {
 
+Backend::Backend(const std::shared_ptr<neurun::backend::IBackendInitializer> &backend_initializer,
+                 const std::shared_ptr<neurun::backend::IInitializerGenerator> &initializer_gen,
+                 const std::shared_ptr<neurun::backend::IStageGenerator> &stage_gen)
+    : initializer_gen(initializer_gen), stage_gen(stage_gen)
+{
+  backend_initializer->initialize();
+}
+
 BackendManager::BackendManager(neurun::codegen::Plan &plan) : _plan(plan)
 {
   const auto &operands = _plan.model().operands();
index 99137eb..a5f51db 100644 (file)
@@ -4,10 +4,19 @@
 #include <memory>
 
 #include "codegen/Plan.h"
-#include "backend/IBackendInitializer.h"
-#include "backend/IInitializerGenerator.h"
-#include "backend/IStageGenerator.h"
-#include "backend/ITensorBuilder.h"
+
+namespace neurun
+{
+namespace backend
+{
+
+struct IBackendInitializer;
+struct IInitializerGenerator;
+struct IStageGenerator;
+struct ITensorBuilder;
+
+} // namespace backend
+} // namespace neurun
 
 namespace internal
 {
@@ -19,11 +28,7 @@ struct Backend
 
   Backend(const std::shared_ptr<neurun::backend::IBackendInitializer> &backend_initializer,
           const std::shared_ptr<neurun::backend::IInitializerGenerator> &initializer_gen,
-          const std::shared_ptr<neurun::backend::IStageGenerator> &stage_gen)
-      : initializer_gen(initializer_gen), stage_gen(stage_gen)
-  {
-    backend_initializer->initialize();
-  }
+          const std::shared_ptr<neurun::backend::IStageGenerator> &stage_gen);
 
   Backend(void) : initializer_gen(nullptr), stage_gen(nullptr)
   {