From 1535b76edb93f1898bc26c7134625ac30db5afe8 Mon Sep 17 00:00:00 2001 From: Sergei Barannikov/AI Tools Lab /SRR/Engineer/Samsung Electronics Date: Thu, 28 Nov 2019 04:52:49 +0300 Subject: [PATCH] [neurun] Change some calls of Operation::name to Operation::opcode (#9261) Replace some calls to `Operation::name` with `Operation::opcode`. Signed-off-by: Sergei Barannikov --- runtime/neurun/core/src/compiler/HEScheduler.cc | 4 ++-- runtime/neurun/core/src/exec/DataflowExecutor.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/neurun/core/src/compiler/HEScheduler.cc b/runtime/neurun/core/src/compiler/HEScheduler.cc index 00b4348..b8129bb 100644 --- a/runtime/neurun/core/src/compiler/HEScheduler.cc +++ b/runtime/neurun/core/src/compiler/HEScheduler.cc @@ -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)}; diff --git a/runtime/neurun/core/src/exec/DataflowExecutor.cc b/runtime/neurun/core/src/exec/DataflowExecutor.cc index a5c0bde..143b4e7 100644 --- a/runtime/neurun/core/src/exec/DataflowExecutor.cc +++ b/runtime/neurun/core/src/exec/DataflowExecutor.cc @@ -37,7 +37,7 @@ int64_t DataflowExecutor::calculateRank(const std::vector &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::max(); } -- 2.7.4