[moco-tf] Use logo for Canonicalizer (#7118)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Wed, 4 Sep 2019 01:44:02 +0000 (10:44 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 4 Sep 2019 01:44:02 +0000 (10:44 +0900)
This will revise Canonicalizer to use logo Phase and ProgressReporter

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
compiler/moco-tf/src/Canonicalizer.cpp

index 3a0989d..c23371f 100644 (file)
@@ -17,8 +17,7 @@
 #include "Canonicalizer.h"
 
 #include "Knob.h"
-#include "Phase.h"
-#include "Transforms.h"
+#include "ProgressReporter.h"
 
 #include "Transforms/ShapeInferencePass.h"
 #include "Transforms/TypeInferencePass.h"
@@ -49,6 +48,8 @@
 #include "Dialect/TFDialect.h"
 #include "Dialect/TFNodes.h"
 
+#include <logo/Phase.h>
+
 #include <stdex/Memory.h>
 
 #include <cassert>
@@ -81,7 +82,7 @@ namespace tf
 
 void Canonicalizer::canonicalize(loco::Graph *g) const
 {
-  moco::tf::Phase phase;
+  logo::Phase phase;
 
   /* TRANSFORM DECLARATION BEGIN */
   // Run shape and type inference at the top
@@ -112,7 +113,9 @@ void Canonicalizer::canonicalize(loco::Graph *g) const
   phase.emplace_back(stdex::make_unique<TanhCanonicalizer>());
   /* TRANSFORM DECLARATION END */
 
-  moco::tf::PhaseRunner<moco::tf::PhaseStrategy::Restart> phase_runner{g};
+  ProgressReporter prog(g, logo::PhaseStrategy::Restart);
+  logo::PhaseRunner<logo::PhaseStrategy::Restart> phase_runner{g};
+  phase_runner.attach(&prog);
   phase_runner.run(phase);
 
   // Assert if graph has TF dialect nodes