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

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