From 05f3e662a45e648eade8e891d3f806a49e84f852 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Staff=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Wed, 21 Nov 2018 15:29:26 +0900 Subject: [PATCH] Merge middleend into compiler directory (#3658) Move SubTensorAnalyzer.cc/h into compiler directory Fix namespace and cmake Signed-off-by: Hyeongseok Oh --- runtimes/neurun/CMakeLists.txt | 3 +-- runtimes/neurun/src/compiler/Compiler.cc | 4 ++-- .../neurun/src/{middleend => compiler}/SubTensorAnalyzer.cc | 4 ++-- .../neurun/src/{middleend => compiler}/SubTensorAnalyzer.h | 10 +++++----- 4 files changed, 10 insertions(+), 11 deletions(-) rename runtimes/neurun/src/{middleend => compiler}/SubTensorAnalyzer.cc (98%) rename runtimes/neurun/src/{middleend => compiler}/SubTensorAnalyzer.h (91%) diff --git a/runtimes/neurun/CMakeLists.txt b/runtimes/neurun/CMakeLists.txt index 70df8a7..0458fb8 100644 --- a/runtimes/neurun/CMakeLists.txt +++ b/runtimes/neurun/CMakeLists.txt @@ -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) diff --git a/runtimes/neurun/src/compiler/Compiler.cc b/runtimes/neurun/src/compiler/Compiler.cc index 693c806..6468029 100644 --- a/runtimes/neurun/src/compiler/Compiler.cc +++ b/runtimes/neurun/src/compiler/Compiler.cc @@ -15,13 +15,13 @@ */ #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}; diff --git a/runtimes/neurun/src/middleend/SubTensorAnalyzer.cc b/runtimes/neurun/src/compiler/SubTensorAnalyzer.cc similarity index 98% rename from runtimes/neurun/src/middleend/SubTensorAnalyzer.cc rename to runtimes/neurun/src/compiler/SubTensorAnalyzer.cc index 44400d8..0292c29 100644 --- a/runtimes/neurun/src/middleend/SubTensorAnalyzer.cc +++ b/runtimes/neurun/src/compiler/SubTensorAnalyzer.cc @@ -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 diff --git a/runtimes/neurun/src/middleend/SubTensorAnalyzer.h b/runtimes/neurun/src/compiler/SubTensorAnalyzer.h similarity index 91% rename from runtimes/neurun/src/middleend/SubTensorAnalyzer.h rename to runtimes/neurun/src/compiler/SubTensorAnalyzer.h index f5a4435..21404c3 100644 --- a/runtimes/neurun/src/middleend/SubTensorAnalyzer.h +++ b/runtimes/neurun/src/compiler/SubTensorAnalyzer.h @@ -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__ -- 2.7.4