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_
25 #include "ExecutorBase.h"
27 #include "compiler/CodeMap.h"
29 #include "util/TracingCtx.h"
37 * @brief Class to handle execution phase. Simple run the sequence of operations that is sorted in
40 class LinearExecutor final : public ExecutorBase
44 * @brief Construct a new LinearExecutor object
45 * @param lowered_graph LoweredGraph object
46 * @param tensor_builders Tensor builders that are currently used
47 * @param code_map @c ir::Operation and its code map
49 LinearExecutor(std::unique_ptr<compiler::LoweredGraph> lowered_graph,
50 backend::BackendContexts &&backend_contexts,
51 const compiler::TensorRegistries &tensor_regs, compiler::CodeMap &&code_map,
52 const std::vector<ir::OperationIndex> &order, const util::TracingCtx *tracing_ctx)
53 : ExecutorBase{std::move(lowered_graph), std::move(backend_contexts), 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_