• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2021 Huawei Technologies Co., Ltd
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 
17 #ifndef MINDSPORE_LITE_SRC_COMMON_CONFIG_FILE_H_
18 #define MINDSPORE_LITE_SRC_COMMON_CONFIG_FILE_H_
19 
20 #include <limits.h>
21 #include <string.h>
22 #include <cstdio>
23 #include <cstdlib>
24 #include <iostream>
25 #include <memory>
26 #include <fstream>
27 #include <string>
28 #include <map>
29 #include <vector>
30 #include <utility>
31 #include "src/common/utils.h"
32 #include "src/common/log_adapter.h"
33 #include "ir/dtype/type_id.h"
34 
35 namespace mindspore {
36 namespace lite {
37 constexpr int MAX_CONFIG_FILE_LENGTH = 1024;
38 #define CONFIG_FILE_EXECUTION_PLAN "execution_plan"
39 
40 int GetSectionInfoFromConfigFile(const std::string &file, const std::string &section_name,
41                                  std::map<std::string, std::string> *section_info);
42 
43 void ParserExecutionPlan(const std::map<std::string, std::string> *config_infos,
44                          std::map<std::string, TypeId> *data_type_plan);
45 
46 }  // namespace lite
47 }  // namespace mindspore
48 
49 #endif  // MINDSPORE_LITE_SRC_COMMON_CONFIG_FILE_H_
50