diff options
Diffstat (limited to 'runtimes/neurun/src/compiler/PlanBuilder.cc')
-rw-r--r-- | runtimes/neurun/src/compiler/PlanBuilder.cc | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/runtimes/neurun/src/compiler/PlanBuilder.cc b/runtimes/neurun/src/compiler/PlanBuilder.cc deleted file mode 100644 index 8ef3fedbf..000000000 --- a/runtimes/neurun/src/compiler/PlanBuilder.cc +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "PlanBuilder.h" - -#include "backend/interface/operand/IObject.h" - -namespace neurun -{ -namespace compiler -{ - -void PlanBuilder::addStage(const Stage &stage) { _stages.emplace_back(stage); } - -void PlanBuilder::finalize(const backend::TensorBuilderSet &tensor_builders) -{ - auto &operands = _plan.operands(); - - // Prepare tensors - for (auto &tensor_builder : tensor_builders) - { - tensor_builder->prepare(); - - // Wrap tensors as Object and store them to plan - tensor_builder->iterate([&](const model::operand::Index &index) { - auto object = tensor_builder->wrapTensor(index); - operands.set(index, object); - }); - } - - // Process Stage - ExecutionBuilder execution_builder{_plan}; - - for (const auto &stage : _stages) - { - stage(execution_builder); - } - - // Allocate Tensor Memory for cl_tensors - for (auto &tensor_builder : tensor_builders) - { - tensor_builder->allocate(); - } -} - -} // namepsace compiler -} // namespace neurun |