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 TrainingCompiler.h
19 * @brief This file contains TrainingCompiler class to define and run compilation phase
22 #ifndef __ONERT_COMPILER_TRAIN_TRAINING_COMPILER_H_
23 #define __ONERT_COMPILER_TRAIN_TRAINING_COMPILER_H_
25 #include "compiler/CompilerOptions.h"
26 #include "compiler/ICompiler.h"
27 #include "compiler/train/TrainingInfo.h"
38 * @brief Class to compile NN package
40 class TrainingCompiler : public ICompiler
44 * @brief Construct a new TrainingCompiler object for single model
45 * @param[in] model model to compile
46 * @param[in] inference_compiler Compiler for inference
47 * @param[in] coptions Compiler Options
48 * @param[in] training_info Training information
50 explicit TrainingCompiler(const std::shared_ptr<ir::NNPkg> &nnpkg,
51 std::vector<std::unique_ptr<CompilerOptions>> &copts,
52 const TrainingInfo &training_info);
55 * @brief Default Construct
58 TrainingCompiler(void) = delete;
61 * @brief Destroy the TrainingCompiler object
63 ~TrainingCompiler() = default;
67 * @brief Do compilation with the options
69 * @return std::shared_ptr<CompilerArtifact> Executors as a result of compilation
71 std::shared_ptr<CompilerArtifact> compile(void);
74 std::shared_ptr<ir::Model> _model;
75 CompilerOptions *_options;
76 const TrainingInfo _training_info;
80 } // namespace compiler
83 #endif // __ONERT_COMPILER_TRAIN_TRAINING_COMPILER_H_