You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

kernel_fusion_stub.cc 2.3 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. namespace mindspore {
  21. namespace kernel {
  22. std::map<int64_t, KernelModPtr> KernelFusion(const std::vector<FusionScopeInfo> &fusion_scopes) {
  23. std::map<int64_t, KernelModPtr> kernel_mod_ret;
  24. for (const auto &fusion_scope_iter : fusion_scopes) {
  25. kernel_mod_ret[fusion_scope_iter.scope_id] = std::make_shared<TbeKernelMod>(nullptr);
  26. }
  27. return kernel_mod_ret;
  28. }
  29. namespace ascend {
  30. std::string AscendKernelCompileManager::AscendOpSelectFormat(const AnfNodePtr &node) { return std::string(); }
  31. bool AscendKernelCompileManager::AscendOpCheckSupported(const AnfNodePtr &node) { return true; }
  32. AscendKernelCompileManager::~AscendKernelCompileManager() {}
  33. bool AscendKernelCompileManager::tbe_init_flag_ = true;
  34. void AscendKernelCompileManager::TbeInitialize() {}
  35. // pre build
  36. void AscendKernelCompileManager::AscendPreBuild(const std::shared_ptr<session::KernelGraph> &kernel_graph) {}
  37. // single op compile
  38. bool AscendKernelCompileManager::AscendSingleOpCompile(const std::vector<AnfNodePtr> &anf_nodes) { return true; }
  39. // fusion op compile
  40. KernelModMap AscendKernelCompileManager::AscendFusionOpCompile(const std::vector<FusionScopeInfo> &fusion_scopes) {
  41. std::map<int64_t, KernelModPtr> kernel_mod_ret;
  42. for (const auto &fusion_scope_iter : fusion_scopes) {
  43. kernel_mod_ret[fusion_scope_iter.scope_id] = std::make_shared<TbeKernelMod>(nullptr);
  44. }
  45. return kernel_mod_ret;
  46. }
  47. void AscendKernelCompileManager::ResetOldTask() {}
  48. } // namespace ascend
  49. } // namespace kernel
  50. } // namespace mindspore