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.

pass.h 1.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * Copyright 2019 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. #ifndef MINDSPORE_CCSRC_PIPELINE_JIT_PASS_H_
  17. #define MINDSPORE_CCSRC_PIPELINE_JIT_PASS_H_
  18. #include <vector>
  19. #include <functional>
  20. #include <utility>
  21. #include <string>
  22. #include "pipeline/jit/resource.h"
  23. namespace mindspore {
  24. namespace pipeline {
  25. using PassItem = std::pair<std::string, std::function<bool(ResourcePtr)>>;
  26. extern std::vector<PassItem> kGePasses;
  27. extern std::vector<PassItem> kVmPasses;
  28. extern std::vector<PassItem> kInlinePasses;
  29. extern std::vector<PassItem> kPynativePasses;
  30. bool CconvPass(const ResourcePtr &res);
  31. bool ValidatePass(const ResourcePtr &res);
  32. bool ConvertPrepareAdapt(const ResourcePtr &res);
  33. bool AddControlDependPass(const ResourcePtr &res);
  34. bool InferenceOptPreparePass(const ResourcePtr &res);
  35. void ReclaimOptimizer();
  36. bool PynativeOptPass(const ResourcePtr &res);
  37. } // namespace pipeline
  38. } // namespace mindspore
  39. #endif // MINDSPORE_CCSRC_PIPELINE_JIT_PASS_H_