[neurun] Change some calls of Operation::name to Operation::opcode (#9261)
authorSergei Barannikov/AI Tools Lab /SRR/Engineer/Samsung Electronics <s.barannikov@samsung.com>
Thu, 28 Nov 2019 01:52:49 +0000 (04:52 +0300)
committer이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Thu, 28 Nov 2019 01:52:49 +0000 (10:52 +0900)
Replace some calls to `Operation::name` with `Operation::opcode`.

Signed-off-by: Sergei Barannikov <s.barannikov@samsung.com>
runtime/neurun/core/src/compiler/HEScheduler.cc
runtime/neurun/core/src/exec/DataflowExecutor.cc

index 00b4348..b8129bb 100644 (file)
@@ -68,7 +68,7 @@ static bool isWorkaroundSkip(const graph::Graph &graph, const backend::Backend *
       Adding exception in stage doesn't help. Because if there is a record for add without
       broadcast, scheduling will select it since it doesn't distinguish broadcast and
       non-broadcast like it does for quant non-quantized*/
-  if (backend->config()->id() == "cpu" && node.name() == "Add")
+  if (backend->config()->id() == "cpu" && node.opcode() == model::OpCode::Add)
   {
     const auto lhs_index{node.getInputs().at(model::operation::Add::Input::LHS)};
     const auto rhs_index{node.getInputs().at(model::operation::Add::Input::RHS)};
@@ -86,7 +86,7 @@ static bool isWorkaroundSkip(const graph::Graph &graph, const backend::Backend *
           Adding exception in stage doesn't help. Because if there is a record for Mul without
           broadcast, scheduling will select it since it doesn't distinguish broadcast and
           non-broadcast like it does for quant non-quantized*/
-  else if (backend->config()->id() == "acl_neon" && node.name() == "Mul")
+  else if (backend->config()->id() == "acl_neon" && node.opcode() == model::OpCode::Mul)
   {
     const auto lhs_index{node.getInputs().at(model::operation::Mul::Input::LHS)};
     const auto rhs_index{node.getInputs().at(model::operation::Mul::Input::RHS)};
index a5c0bde..143b4e7 100644 (file)
@@ -37,7 +37,7 @@ int64_t DataflowExecutor::calculateRank(const std::vector<model::Element> &opera
     auto it = _indexed_ranks->find(element.index);
     if (it == _indexed_ranks->end())
     {
-      assert(element.node->name() == "Permute");
+      assert(element.node->opcode() == model::OpCode::Permute);
       // assign int32_t::max to prevent integer overflow
       rank += std::numeric_limits<int32_t>::max();
     }