From: 이한종/동작제어Lab(SR)/Engineer/삼성전자 Date: Wed, 5 Sep 2018 04:15:24 +0000 (+0900) Subject: [neurun] Use Index as key for unordered_set (#2590) X-Git-Tag: 0.2~90 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf467a8ec85cc0566da82cbe0d0b4426620ba8fb;p=platform%2Fcore%2Fml%2Fnnfw.git [neurun] Use Index as key for unordered_set (#2590) This commit revises `unordered_set`s to use `graph::Index` as key which used `int` as key because hash function was not exist. Signed-off-by: Hanjoung Lee --- diff --git a/runtimes/neurun/src/backend/acl_cl/TensorBuilder.cc b/runtimes/neurun/src/backend/acl_cl/TensorBuilder.cc index 4ff2efd..880ff2d 100644 --- a/runtimes/neurun/src/backend/acl_cl/TensorBuilder.cc +++ b/runtimes/neurun/src/backend/acl_cl/TensorBuilder.cc @@ -20,7 +20,7 @@ void TensorBuilder::mark(const ::neurun::graph::operand::Index &ind) { assert(_tensors.size() == 0); - _inds.insert(ind.asInt()); + _inds.insert(ind); } void TensorBuilder::prepare(codegen::Plan &plan, diff --git a/runtimes/neurun/src/backend/acl_cl/TensorBuilder.h b/runtimes/neurun/src/backend/acl_cl/TensorBuilder.h index c593416..e3c8664 100644 --- a/runtimes/neurun/src/backend/acl_cl/TensorBuilder.h +++ b/runtimes/neurun/src/backend/acl_cl/TensorBuilder.h @@ -30,7 +30,7 @@ public: std::shared_ptr<::arm_compute::CLTensor> at(const ::neurun::graph::operand::Index &ind); private: - std::unordered_set _inds; + std::unordered_set _inds; std::unordered_map> _tensors; }; diff --git a/runtimes/neurun/src/backend/cpu/TensorBuilder.cc b/runtimes/neurun/src/backend/cpu/TensorBuilder.cc index f25a954..3b7fa80 100644 --- a/runtimes/neurun/src/backend/cpu/TensorBuilder.cc +++ b/runtimes/neurun/src/backend/cpu/TensorBuilder.cc @@ -20,7 +20,7 @@ void TensorBuilder::mark(const ::neurun::graph::operand::Index &ind) { assert(_tensors.size() == 0); - _inds.insert(ind.asInt()); + _inds.insert(ind); } void TensorBuilder::prepare(codegen::Plan &plan, diff --git a/runtimes/neurun/src/backend/cpu/TensorBuilder.h b/runtimes/neurun/src/backend/cpu/TensorBuilder.h index 80fa12f..37f3581 100644 --- a/runtimes/neurun/src/backend/cpu/TensorBuilder.h +++ b/runtimes/neurun/src/backend/cpu/TensorBuilder.h @@ -6,6 +6,7 @@ #include "backend/ITensorBuilder.h" #include "backend/cpu/operand/Tensor.h" +#include "graph/operand/Index.h" namespace neurun { @@ -29,7 +30,7 @@ public: std::shared_ptr at(const ::neurun::graph::operand::Index &ind); private: - std::unordered_set _inds; + std::unordered_set _inds; std::unordered_map> _tensors; };