2 * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file LinearExecutor.h
19 * @brief This file contains LinearExecutor class to define and run execution phase
22 #ifndef __ONERT_EXEC_EXECUTOR_H_
23 #define __ONERT_EXEC_EXECUTOR_H_
26 #include "ExecutorBase.h"
27 #include "compiler/Linear.h"
28 #include "exec/FunctionSequence.h"
29 #include "compiler/CodeMap.h"
30 #include "util/TracingCtx.h"
38 * @brief Class to handle execution phase. Simple run the sequence of operations that is sorted in
41 class LinearExecutor final : public ExecutorBase
45 * @brief Construct a new LinearExecutor object
46 * @param lowered_graph LoweredGraph object
47 * @param tensor_builders Tensor builders that are currently used
48 * @param code_map OpSequence and its code map
50 LinearExecutor(std::unique_ptr<compiler::LoweredGraph> lowered_graph,
51 const compiler::TensorRegistries &tensor_regs, compiler::CodeMap &&code_map,
52 const std::vector<ir::OpSequenceIndex> &order, const util::TracingCtx *tracing_ctx)
53 : ExecutorBase{std::move(lowered_graph), tensor_regs, tracing_ctx}
55 for (auto index : order)
57 _code.emplace_back(std::move(code_map.at(index)));
62 void executeImpl(void) override;
65 std::vector<compiler::CodeAndInfo> _code;
71 #endif // __ONERT_EXEC_EXECUTOR_H_