Merge middleend into compiler directory (#3658)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 21 Nov 2018 06:29:26 +0000 (15:29 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 21 Nov 2018 06:29:26 +0000 (15:29 +0900)
Move SubTensorAnalyzer.cc/h into compiler directory
Fix namespace and cmake

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/CMakeLists.txt
runtimes/neurun/src/compiler/Compiler.cc
runtimes/neurun/src/compiler/SubTensorAnalyzer.cc [moved from runtimes/neurun/src/middleend/SubTensorAnalyzer.cc with 98% similarity]
runtimes/neurun/src/compiler/SubTensorAnalyzer.h [moved from runtimes/neurun/src/middleend/SubTensorAnalyzer.h with 91% similarity]

index 70df8a7..0458fb8 100644 (file)
@@ -14,7 +14,6 @@ add_subdirectory(src/backend)
 
 file(GLOB SOURCES "src/*.cc")
 file(GLOB_RECURSE SOURCES_FRONTEND "src/frontend/*.cc")
-file(GLOB_RECURSE SOURCES_MIDDLEEND "src/middleend/*.cc")
 file(GLOB SOURCES_BACKEND "src/backend/*.cc")
 file(GLOB_RECURSE SOURCES_INTERNAL "src/internal/*.cc")
 file(GLOB_RECURSE SOURCES_GRAPH "src/graph/*.cc")
@@ -25,7 +24,7 @@ file(GLOB_RECURSE SOURCES_COMPILER "src/compiler/*.cc")
 file(GLOB_RECURSE SOURCES_VERIFIER "src/verifier/*.cc")
 file(GLOB_RECURSE SOURCES_VERIFIER "src/util/*.cc")
 
-set(SOURCES ${SOURCES} ${SOURCES_FRONTEND} ${SOURCES_MIDDLEEND} ${SOURCES_BACKEND} ${SOURCES_INTERNAL} ${SOURCES_GRAPH} ${SOURCES_LINEAR} ${SOURCES_CODEGEN} ${SOURCES_DUMPER} ${SOURCES_COMPILER} ${SOURCES_VERIFIER})
+set(SOURCES ${SOURCES} ${SOURCES_FRONTEND} ${SOURCES_BACKEND} ${SOURCES_INTERNAL} ${SOURCES_GRAPH} ${SOURCES_LINEAR} ${SOURCES_CODEGEN} ${SOURCES_DUMPER} ${SOURCES_COMPILER} ${SOURCES_VERIFIER})
 
 # NOTE For now ARMCompute is necessary
 # TODO Remove required package below(should be optional)
index 693c806..6468029 100644 (file)
  */
 
 #include "Compiler.h"
+#include "SubTensorAnalyzer.h"
 
 #include "graph/dumper/Dumper.h"
 #include "dumper/dot/DotDumper.h"
 #include "codegen/IPlanBuilder.h"
 #include "codegen/OperationValidator.h"
 #include "codegen/PlanBuilder.h"
-#include "middleend/SubTensorAnalyzer.h"
 #include "codegen/ConstantInitializer.h"
 #include "graph/operation/LowerInfo.h"
 
@@ -68,7 +68,7 @@ void Compiler::compile(void)
   //    finalize: generate tensor using subtensor info, then execute stage
   // Generated SubTensorInfo is in operand(Object)
   // for easy pass SubTensorInfo to plan builder and tensor builder
-  linear->accept(neurun::middleend::SubTensorAnalyzer{graph.operands()});
+  linear->accept(SubTensorAnalyzer{graph.operands()});
 
   neurun::codegen::PlanBuilder plan_builder{plan};
 
@@ -27,7 +27,7 @@
 
 namespace neurun
 {
-namespace middleend
+namespace compiler
 {
 
 void SubTensorAnalyzer::visit(const graph::operation::Conv2DNode &)
@@ -122,5 +122,5 @@ void SubTensorAnalyzer::visit(const graph::operation::AddNode &)
   // DO NOTHING
 }
 
-} // namespace middleend
+} // namespace compiler
 } // namespace neurun
@@ -20,8 +20,8 @@
  *        using operation visitor
  */
 
-#ifndef __NEURUN_MIDDLEEND_SUBTENSOR_ANALYZER_H__
-#define __NEURUN_MIDDLEEND_SUBTENSOR_ANALYZER_H__
+#ifndef __NEURUN_COMPILER_SUBTENSOR_ANALYZER_H__
+#define __NEURUN_COMPILER_SUBTENSOR_ANALYZER_H__
 
 #include "graph/operation/NodeVisitor.h"
 
@@ -38,7 +38,7 @@ class Set;
 
 namespace neurun
 {
-namespace middleend
+namespace compiler
 {
 
 /**
@@ -69,7 +69,7 @@ private:
   neurun::graph::operand::Set &_ctx;
 };
 
-} // namespace middleend
+} // namespace compiler
 } // namespace neurun
 
-#endif // __NEURUN_MIDDLEEND_SUBTENSOR_ANALYZER_H__
+#endif // __NEURUN_COMPILER_SUBTENSOR_ANALYZER_H__