2 * Copyright (c) 2023 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 MultiModelCompiler.h
19 * @brief This file contains MultiModelCompiler class to define and run compilation phase
22 #ifndef __ONERT_COMPILER_MULTI_MODEL_COMPILER_H__
23 #define __ONERT_COMPILER_MULTI_MODEL_COMPILER_H__
25 #include "compiler/CompilerOptions.h"
26 #include "compiler/ICompiler.h"
35 * @brief Class to compile NN package
37 class MultiModelCompiler final : public ICompiler
41 * @brief Construct a new Compiler object for NN package
42 * @param[in] nnpkg NN package to compile
43 * @param[in] coptions Compiler option vector for each model in package
45 MultiModelCompiler(const std::shared_ptr<ir::NNPkg> &nnpkg,
46 std::vector<std::unique_ptr<CompilerOptions>> &copts);
49 * @brief Destroy the MultiModelCompiler object
51 ~MultiModelCompiler() = default;
55 * @brief Do compilation with the options
57 * @return std::shared_ptr<CompilerArtifact> Executors as a result of compilation
59 std::shared_ptr<CompilerArtifact> compile(void);
62 std::shared_ptr<ir::Graph> &primary_subgraph()
64 return _nnpkg->primary_model()->at(ir::SubgraphIndex{0});
68 std::shared_ptr<ir::NNPkg> _nnpkg;
69 std::vector<CompilerOptions *> _voptions;
72 } // namespace compiler
75 #endif // __ONERT_COMPILER_MULTI_MODEL_COMPILER_H__