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.

context_extends.h 2.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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_UTILS_CONTEXT_CONTEXT_EXTENDS_H
  17. #define MINDSPORE_CCSRC_UTILS_CONTEXT_CONTEXT_EXTENDS_H
  18. #include <map>
  19. #include <string>
  20. #include <memory>
  21. #include "utils/ms_context.h"
  22. #include "utils/tensorprint_utils.h"
  23. #include "utils/convert_utils.h"
  24. #ifndef NO_DLIB
  25. #include "tdt/tsd_client.h"
  26. #include "tdt/tdt_host_interface.h"
  27. #include "tdt/data_common.h"
  28. #endif
  29. #ifdef ENABLE_GE
  30. #include "transform/graph_ir/df_graph_manager.h"
  31. #endif
  32. namespace mindspore {
  33. namespace context {
  34. bool OpenTsd(const std::shared_ptr<MsContext> &inst_context);
  35. bool CloseTsd(const std::shared_ptr<MsContext> &inst_context, bool force = false);
  36. void SetHcclOptions(const std::shared_ptr<MsContext> &inst_context, std::map<std::string, std::string> *ge_options);
  37. void GetGeOptions(const std::shared_ptr<MsContext> &inst_context, std::map<std::string, std::string> *ge_options);
  38. void SetDisableReuseMemoryFlag(std::map<std::string, std::string> *ge_options);
  39. bool InitGe(const std::shared_ptr<MsContext> &inst_context);
  40. bool FinalizeGe(const std::shared_ptr<MsContext> &inst_context, bool force = false);
  41. bool PynativeInitGe(const std::shared_ptr<MsContext> &inst_context);
  42. bool IsTsdOpened(const std::shared_ptr<MsContext> &inst_context);
  43. bool IsGeInited(const std::shared_ptr<MsContext> &inst_context);
  44. } // namespace context
  45. } // namespace mindspore
  46. #endif // MINDSPORE_CCSRC_UTILS_CONTEXT_CONTEXT_EXTENDS_H