1 /** 2 * Copyright 2023 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_EXTENDRT_DELEGATE_ASCEND_GE_AOE_API_TUNING_PROCESS_H_ 18 #define MINDSPORE_LITE_SRC_EXTENDRT_DELEGATE_ASCEND_GE_AOE_API_TUNING_PROCESS_H_ 19 20 #include <memory> 21 #include <map> 22 #include <vector> 23 #include <string> 24 #include "include/transform/graph_ir/types.h" 25 #include "include/api/status.h" 26 #include "cxx_api/model/acl/acl_model_options.h" 27 #include "ge/ge_api.h" 28 29 namespace mindspore { 30 using ConfigInfos = std::map<std::string, std::map<std::string, std::string>>; 31 class AoeApiTuning { 32 public: 33 Status AoeTurningGraph(const std::shared_ptr<ge::Session> &session, const transform::DfGraphPtr &graph, 34 const std::vector<ge::Tensor> &inputs, const std::shared_ptr<Context> &context, 35 const ConfigInfos &config_infos); 36 37 private: 38 std::map<std::string, std::string> GetAoeGlobalOptions(const std::shared_ptr<Context> &context, 39 const ConfigInfos &config_infos); 40 std::map<std::string, std::string> GetAoeTuningOptions(const std::shared_ptr<Context> &context, 41 const ConfigInfos &config_infos); 42 std::vector<std::string> GetAoeJobType(const std::shared_ptr<Context> &context, const ConfigInfos &config_infos); 43 44 Status ExecuteAoe(const std::shared_ptr<ge::Session> &session, const transform::DfGraphPtr &graph, 45 const std::vector<ge::Tensor> &inputs, const std::vector<std::string> &job_types, 46 const std::map<std::string, std::string> &global_options, 47 const std::map<std::string, std::string> &tuning_options); 48 }; 49 } // namespace mindspore 50 #endif // MINDSPORE_LITE_SRC_EXTENDRT_DELEGATE_ASCEND_GE_AOE_API_TUNING_PROCESS_H_ 51