diff options
author | 김용섭/On-Device Lab(SR)/Engineer/삼성전자 <yons.kim@samsung.com> | 2019-04-16 08:44:08 +0900 |
---|---|---|
committer | 박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com> | 2019-04-16 08:44:08 +0900 |
commit | 8352c6431b910b8f630e4af0437d180559286557 (patch) | |
tree | e2ac880e2d92dbf5fd5399862beda29acfd8bf8c /runtimes | |
parent | d65f769196f3d0bb929ca25b1fbbd21ff452a923 (diff) | |
download | nnfw-8352c6431b910b8f630e4af0437d180559286557.tar.gz nnfw-8352c6431b910b8f630e4af0437d180559286557.tar.bz2 nnfw-8352c6431b910b8f630e4af0437d180559286557.zip |
[neurun] Change from SubgraphSet to SubgraphSequence (#4996)
Change the name SubgraphSet. Actually SubgraphSet has elements in order
so that SubgraphSequence is proper name.
Signed-off-by: Yongseop Kim <yons.kim@samsung.com>
Diffstat (limited to 'runtimes')
-rw-r--r-- | runtimes/neurun/core/include/graph/Graph.h | 8 | ||||
-rw-r--r-- | runtimes/neurun/core/src/compiler/Compiler.cc | 2 | ||||
-rw-r--r-- | runtimes/neurun/core/src/exec/ExecutorBase.cc | 4 | ||||
-rw-r--r-- | runtimes/neurun/core/src/exec/ExecutorBase.h | 4 | ||||
-rw-r--r-- | runtimes/neurun/core/src/exec/LinearExecutor.h | 4 | ||||
-rw-r--r-- | runtimes/neurun/core/src/graph/Graph.cc | 14 | ||||
-rw-r--r-- | runtimes/neurun/core/src/linear/Linear.cc | 8 | ||||
-rw-r--r-- | runtimes/neurun/core/src/linear/Linear.h | 9 |
8 files changed, 28 insertions, 25 deletions
diff --git a/runtimes/neurun/core/include/graph/Graph.h b/runtimes/neurun/core/include/graph/Graph.h index 0843ffb08..909bba9e5 100644 --- a/runtimes/neurun/core/include/graph/Graph.h +++ b/runtimes/neurun/core/include/graph/Graph.h @@ -127,9 +127,11 @@ public: bool isBuildingPhase(void) const { return _phase == Phase::BUILDING; } std::shared_ptr<const model::Model> shareModel() { return _model; } std::unique_ptr<graph::LowerInfoMap> releaseLowerInfo() { return std::move(_lower_info_map); } - std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> releaseSubgraphSet() + // TODO Change this to releaseSubgraphContext() + std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> + releaseSubgraphSequence() { - return std::move(_subg_set); + return std::move(_subg_seq); } private: @@ -173,7 +175,7 @@ private: void partition(); private: - std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> _subg_set; + std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> _subg_seq; }; } // namespace graph diff --git a/runtimes/neurun/core/src/compiler/Compiler.cc b/runtimes/neurun/core/src/compiler/Compiler.cc index a545fb094..5d9a68758 100644 --- a/runtimes/neurun/core/src/compiler/Compiler.cc +++ b/runtimes/neurun/core/src/compiler/Compiler.cc @@ -142,7 +142,7 @@ std::shared_ptr<exec::IExecutor> Compiler::createLinearExecutor(graph::Graph &mo auto plan = std::make_shared<Plan>(operation_sequence); return std::make_shared<exec::LinearExecutor>(model.shareModel(), operand_context, - linear->releaseSubgraphSet(), + linear->releaseSubgraphSequence(), linear->releaseLowerInfo(), plan); } diff --git a/runtimes/neurun/core/src/exec/ExecutorBase.cc b/runtimes/neurun/core/src/exec/ExecutorBase.cc index 8948d0a4c..58d05ce37 100644 --- a/runtimes/neurun/core/src/exec/ExecutorBase.cc +++ b/runtimes/neurun/core/src/exec/ExecutorBase.cc @@ -24,9 +24,9 @@ namespace exec ExecutorBase::ExecutorBase( const std::shared_ptr<const model::Model> &model, const std::shared_ptr<compiler::OperandContext> &operand_context, - std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> subg_set, + std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> subg_seq, std::unique_ptr<graph::LowerInfoMap> lower_info) - : _model{model}, _operand_context{operand_context}, _subg_set{std::move(subg_set)}, + : _model{model}, _operand_context{operand_context}, _subg_seq{std::move(subg_seq)}, _lower_info{std::move(lower_info)} { _sources.resize(_model->inputs.size()); diff --git a/runtimes/neurun/core/src/exec/ExecutorBase.h b/runtimes/neurun/core/src/exec/ExecutorBase.h index ea8b01de7..72cef7ad4 100644 --- a/runtimes/neurun/core/src/exec/ExecutorBase.h +++ b/runtimes/neurun/core/src/exec/ExecutorBase.h @@ -38,7 +38,7 @@ class ExecutorBase : public IExecutor public: ExecutorBase(const std::shared_ptr<const model::Model> &model, const std::shared_ptr<compiler::OperandContext> &operand_context, - std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> subg_set, + std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> subg_seq, std::unique_ptr<graph::LowerInfoMap> lower_info); virtual ~ExecutorBase() = default; @@ -123,7 +123,7 @@ private: protected: std::shared_ptr<const model::Model> _model; std::shared_ptr<compiler::OperandContext> _operand_context; - std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> _subg_set; + std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> _subg_seq; std::unique_ptr<graph::LowerInfoMap> _lower_info; std::vector<std::unique_ptr<ISource>> _sources; std::vector<std::unique_ptr<ISink>> _sinks; diff --git a/runtimes/neurun/core/src/exec/LinearExecutor.h b/runtimes/neurun/core/src/exec/LinearExecutor.h index d1e8357ca..e0b2a2764 100644 --- a/runtimes/neurun/core/src/exec/LinearExecutor.h +++ b/runtimes/neurun/core/src/exec/LinearExecutor.h @@ -43,10 +43,10 @@ public: */ LinearExecutor(const std::shared_ptr<const model::Model> &model, const std::shared_ptr<compiler::OperandContext> &operand_context, - std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> subg_set, + std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> subg_seq, std::unique_ptr<graph::LowerInfoMap> lower_info, const std::shared_ptr<const neurun::compiler::Plan> &plan) - : ExecutorBase{model, operand_context, std::move(subg_set), std::move(lower_info)}, + : ExecutorBase{model, operand_context, std::move(subg_seq), std::move(lower_info)}, _plan{plan} { } diff --git a/runtimes/neurun/core/src/graph/Graph.cc b/runtimes/neurun/core/src/graph/Graph.cc index 9d2dd5d6a..64f586709 100644 --- a/runtimes/neurun/core/src/graph/Graph.cc +++ b/runtimes/neurun/core/src/graph/Graph.cc @@ -249,7 +249,7 @@ std::unique_ptr<linear::Linear> Graph::linearize(void) { assert(_phase == Phase::MODEL); - auto linear = nnfw::cpp14::make_unique<linear::Linear>(shareModel(), releaseSubgraphSet(), + auto linear = nnfw::cpp14::make_unique<linear::Linear>(shareModel(), releaseSubgraphSequence(), releaseLowerInfo()); // TODO Move the operations and operands to linear object @@ -350,7 +350,7 @@ void Graph::partition() // [CONCAT] // - _subg_set = nnfw::cpp14::make_unique<std::vector<std::unique_ptr<model::operation::Subgraph>>>(); + _subg_seq = nnfw::cpp14::make_unique<std::vector<std::unique_ptr<model::operation::Subgraph>>>(); { std::unique_ptr<model::operation::Subgraph> subg = nullptr; @@ -379,21 +379,21 @@ void Graph::partition() if (finish_subg) { - _subg_set->emplace_back(std::move(subg)); + _subg_seq->emplace_back(std::move(subg)); subg = nullptr; } }); // If the last subgraph leaves, append it to the subgraph set if (subg && subg->operations().size() > 0) - _subg_set->emplace_back(std::move(subg)); + _subg_seq->emplace_back(std::move(subg)); // NOTE. Now these subgraph are on the reverse order } // Set input/output of each subgraph while reversing - std::reverse(_subg_set->begin(), _subg_set->end()); - for (auto &subg : *_subg_set) + std::reverse(_subg_seq->begin(), _subg_seq->end()); + for (auto &subg : *_subg_seq) { // output auto it = std::begin(subg->operations()); @@ -407,7 +407,7 @@ void Graph::partition() } VERBOSE(Subgraph) << "Subgraphs" << std::endl; - for (const auto &subg : *_subg_set) + for (const auto &subg : *_subg_seq) VERBOSE(Subgraph) << subg->getStr() << std::endl; } diff --git a/runtimes/neurun/core/src/linear/Linear.cc b/runtimes/neurun/core/src/linear/Linear.cc index 005124b85..a573b5dd2 100644 --- a/runtimes/neurun/core/src/linear/Linear.cc +++ b/runtimes/neurun/core/src/linear/Linear.cc @@ -35,12 +35,12 @@ namespace linear { Linear::Linear(const std::shared_ptr<const model::Model> &model, - std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> subg_set, + std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> subg_seq, std::unique_ptr<graph::LowerInfoMap> lower_info_map) - : _model(model), _subg_set(std::move(subg_set)), _lower_info_map(std::move(lower_info_map)) + : _model(model), _subg_seq(std::move(subg_seq)), _lower_info_map(std::move(lower_info_map)) { - assert(_model && _subg_set && _lower_info_map); - for (const auto &subg : *_subg_set) + assert(_model && _subg_seq && _lower_info_map); + for (const auto &subg : *_subg_seq) { // Assume that the lower_infos of all nodes on a subgraph are identified on the subgraph const auto &first_ind = subg->operations()[0].index; diff --git a/runtimes/neurun/core/src/linear/Linear.h b/runtimes/neurun/core/src/linear/Linear.h index 78ff35c11..1720be2a4 100644 --- a/runtimes/neurun/core/src/linear/Linear.h +++ b/runtimes/neurun/core/src/linear/Linear.h @@ -57,7 +57,7 @@ class Linear { public: Linear(const std::shared_ptr<const model::Model> &model, - std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> subg_set, + std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> subg_seq, std::unique_ptr<graph::LowerInfoMap> lower_info_map); public: @@ -74,9 +74,10 @@ public: std::unique_ptr<graph::LowerInfoMap> releaseLowerInfo() { return std::move(_lower_info_map); } graph::LowerInfoMap *getLowerInfo() { return _lower_info_map.get(); } - std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> releaseSubgraphSet() + std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> + releaseSubgraphSequence() { - return std::move(_subg_set); + return std::move(_subg_seq); } private: @@ -86,7 +87,7 @@ private: private: std::shared_ptr<const model::Model> _model; - std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> _subg_set; + std::unique_ptr<std::vector<std::unique_ptr<model::operation::Subgraph>>> _subg_seq; std::unique_ptr<graph::LowerInfoMap> _lower_info_map; std::vector<Element> _elements; }; |