[neurun] Rename Planner as OperationValidator (#3582)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Tue, 20 Nov 2018 05:01:14 +0000 (14:01 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 20 Nov 2018 05:01:14 +0000 (14:01 +0900)
Now Planner has only have assertions, so rename accordingly.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/src/codegen/OperationValidator.cc [moved from runtimes/neurun/src/codegen/Planner.cc with 80% similarity]
runtimes/neurun/src/codegen/OperationValidator.h [moved from runtimes/neurun/src/codegen/Planner.h with 85% similarity]
runtimes/neurun/src/frontend/wrapper/compilation.cc

similarity index 80%
rename from runtimes/neurun/src/codegen/Planner.cc
rename to runtimes/neurun/src/codegen/OperationValidator.cc
index a3e494c..9416edf 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "Planner.h"
+#include "OperationValidator.h"
 
 #include <typeinfo>
 
@@ -29,22 +29,22 @@ namespace neurun
 namespace codegen
 {
 
-void Planner::visit(const graph::operation::Conv2DNode &)
+void OperationValidator::visit(const graph::operation::Conv2DNode &)
 {
   // DO NOTHING
 }
 
-void Planner::visit(const graph::operation::MaxPool2DNode &)
+void OperationValidator::visit(const graph::operation::MaxPool2DNode &)
 {
   // DO NOTHING
 }
 
-void Planner::visit(const graph::operation::AvgPool2DNode &)
+void OperationValidator::visit(const graph::operation::AvgPool2DNode &)
 {
   // DO NOTHING
 }
 
-void Planner::visit(const graph::operation::ConcatNode &node)
+void OperationValidator::visit(const graph::operation::ConcatNode &node)
 {
   (void)node; // NOTE To prevent from unused variable warning
 
@@ -54,12 +54,12 @@ void Planner::visit(const graph::operation::ConcatNode &node)
          3);
 }
 
-void Planner::visit(const graph::operation::FullyConnectedNode &)
+void OperationValidator::visit(const graph::operation::FullyConnectedNode &)
 {
   // DO NOTHING
 }
 
-void Planner::visit(const graph::operation::ReshapeNode &node)
+void OperationValidator::visit(const graph::operation::ReshapeNode &node)
 {
   (void)node; // NOTE To prevent from unused variable warning
 
@@ -83,7 +83,7 @@ void Planner::visit(const graph::operation::ReshapeNode &node)
           _ctx.at(input_index).shape().dim(2)) == _ctx.at(output_index).shape().dim(1));
 }
 
-void Planner::visit(const graph::operation::SoftmaxNode &node)
+void OperationValidator::visit(const graph::operation::SoftmaxNode &node)
 {
   (void)node; // NOTE To prevent from unused variable warning
 
@@ -101,12 +101,12 @@ void Planner::visit(const graph::operation::SoftmaxNode &node)
   assert(_ctx.at(input_index).shape().dim(1) == _ctx.at(output_index).shape().dim(1));
 }
 
-void Planner::visit(const graph::operation::NOPNode &)
+void OperationValidator::visit(const graph::operation::NOPNode &)
 {
   // DO NOTHING
 }
 
-void Planner::visit(const graph::operation::PermuteNode &node)
+void OperationValidator::visit(const graph::operation::PermuteNode &node)
 {
   (void)node; // NOTE To prevent from unused variable warning
 
@@ -118,7 +118,7 @@ void Planner::visit(const graph::operation::PermuteNode &node)
   assert(_ctx.at(output_index).shape().rank() == _ctx.at(input_index).shape().rank());
 }
 
-void Planner::visit(const graph::operation::AddNode &)
+void OperationValidator::visit(const graph::operation::AddNode &)
 {
   // DO NOTHING
 }
similarity index 85%
rename from runtimes/neurun/src/codegen/Planner.h
rename to runtimes/neurun/src/codegen/OperationValidator.h
index d97aeed..a325bb0 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef __NEURUN_CODEGEN_PLANNER_H__
-#define __NEURUN_CODEGEN_PLANNER_H__
+#ifndef __NEURUN_CODEGEN_OPERATION_VALIDATOR_H__
+#define __NEURUN_CODEGEN_OPERATION_VALIDATOR_H__
 
 #include "graph/operation/NodeVisitor.h"
 
@@ -35,11 +35,10 @@ namespace neurun
 namespace codegen
 {
 
-// FIXME Rename Planner to OperationAsserter
-class Planner : public graph::operation::NodeVisitor
+class OperationValidator : public graph::operation::NodeVisitor
 {
 public:
-  Planner(const neurun::graph::operand::Set &ctx) : _ctx{ctx} {}
+  OperationValidator(const neurun::graph::operand::Set &ctx) : _ctx{ctx} {}
 
 public:
   virtual void visit(const graph::operation::Conv2DNode &) override;
@@ -60,4 +59,4 @@ private:
 } // namespace codegen
 } // namespace neurun
 
-#endif // __NEURUN_CODEGEN_PLANNER_H__
+#endif // __NEURUN_CODEGEN_OPERATION_VALIDATOR_H__
index 45700e5..2aec8ad 100644 (file)
@@ -20,7 +20,7 @@
 #include "graph/dumper/Dumper.h"
 #include "dumper/dot/DotDumper.h"
 #include "codegen/IPlanBuilder.h"
-#include "codegen/Planner.h"
+#include "codegen/OperationValidator.h"
 #include "codegen/PlanBuilder.h"
 #include "middleend/SubTensorAnalyzer.h"
 #include "codegen/ConstantInitializer.h"
@@ -67,8 +67,7 @@ int ANeuralNetworksCompilation::finish()
 
   neurun::codegen::PlanBuilder plan_builder{plan};
 
-  // NOTE This is actually an Asserter. Will be renamed
-  linear->accept(neurun::codegen::Planner{operands});
+  linear->accept(neurun::codegen::OperationValidator{operands});
 
   // Plan building
   linear->iterate([&](const neurun::graph::operation::Node *node) {