• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2020 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 #include "backend/kernel_compiler/kernel_fusion.h"
17 #include "backend/kernel_compiler/tbe/tbe_kernel_mod.h"
18 #include "backend/kernel_compiler/tbe/ascend_kernel_compile.h"
19 #include "utils/ms_utils.h"
20 
21 namespace mindspore {
22 namespace kernel {
23 std::map<int64_t, KernelModPtr> KernelFusion(const std::vector<FusionScopeInfo> &fusion_scopes) {
24   std::map<int64_t, KernelModPtr> kernel_mod_ret;
25   for (const auto &fusion_scope_iter : fusion_scopes) {
26     kernel_mod_ret[fusion_scope_iter.scope_id] = std::make_shared<TbeKernelMod>(nullptr);
27   }
28   return kernel_mod_ret;
29 }
30 namespace ascend {
31 std::string AscendKernelCompileManager::AscendOpSelectFormat(const AnfNodePtr &node) { return std::string(); }
32 bool AscendKernelCompileManager::AscendOpCheckSupported(const AnfNodePtr &node) { return true; }
33 AscendKernelCompileManager::~AscendKernelCompileManager() {}
34 bool AscendKernelCompileManager::tbe_init_flag_ = true;
35 
36 void AscendKernelCompileManager::TbeInitialize() {}
37 // pre build
38 void AscendKernelCompileManager::AscendPreBuild(const std::shared_ptr<session::KernelGraph> &kernel_graph) {}
39 // single op compile
40 bool AscendKernelCompileManager::AscendSingleOpCompile(const std::vector<AnfNodePtr> &anf_nodes) { return true; }
41 // fusion op compile
42 KernelModMap AscendKernelCompileManager::AscendFusionOpCompile(const std::vector<FusionScopeInfo> &fusion_scopes) {
43   std::map<int64_t, KernelModPtr> kernel_mod_ret;
44   for (const auto &fusion_scope_iter : fusion_scopes) {
45     kernel_mod_ret[fusion_scope_iter.scope_id] = std::make_shared<TbeKernelMod>(nullptr);
46   }
47   return kernel_mod_ret;
48 }
49 void AscendKernelCompileManager::ResetOldTask() {}
50 }  // namespace ascend
51 }  // namespace kernel
52 }  // namespace mindspore
53