diff --git a/torch_npu/csrc/core/npu/NPUStream.cpp b/torch_npu/csrc/core/npu/NPUStream.cpp index 76e998c7d63bcc03a0f0dbe87aff285970cd2577..124dd499cd653b43329162cf6af8f47d7ef2bcc0 100644 --- a/torch_npu/csrc/core/npu/NPUStream.cpp +++ b/torch_npu/csrc/core/npu/NPUStream.cpp @@ -719,4 +719,9 @@ bool check_dequeue_need_use(aclrtStream stream) } return false; } + +bool is_core_control_enabled() +{ + return enable_core_control.load(std::memory_order_relaxed); +} } // namespace c10_npu diff --git a/torch_npu/csrc/core/npu/NPUStream.h b/torch_npu/csrc/core/npu/NPUStream.h index 38ad1a1fa83c54737adb24b6a27b773a71adf82b..0b267c11eaedb8a7e01ee0e538ab9cd84905701c 100644 --- a/torch_npu/csrc/core/npu/NPUStream.h +++ b/torch_npu/csrc/core/npu/NPUStream.h @@ -154,6 +154,8 @@ bool StreamInitFlag(c10::DeviceIndex device_index); C10_NPU_API bool check_enqueue_need_use(aclrtStream stream); C10_NPU_API bool check_dequeue_need_use(aclrtStream stream); + +C10_NPU_API bool is_core_control_enabled(); } // namespace c10_npu namespace std { diff --git a/torch_npu/csrc/core/npu/interface/AclInterface.cpp b/torch_npu/csrc/core/npu/interface/AclInterface.cpp index 069c82eec8deeabdc67b851308771daafe86e3b9..752c978d2df5e7c00b6bbcd883ca8fe14fc6a2d2 100644 --- a/torch_npu/csrc/core/npu/interface/AclInterface.cpp +++ b/torch_npu/csrc/core/npu/interface/AclInterface.cpp @@ -1227,12 +1227,5 @@ aclError AclrtGetResInCurrentThread(aclrtDevResModelType type, uint32_t* value) return func(type, value); } -bool IsExistGetResInCurrentThread() -{ - typedef aclError (*AclrtGetResInCurrentThread)(aclrtDevResModelType, uint32_t*); - static AclrtGetResInCurrentThread func = (AclrtGetResInCurrentThread) GET_FUNC(aclrtGetResInCurrentThread); - return func != nullptr; -} - } // namespace acl } // namespace c10 diff --git a/torch_npu/csrc/core/npu/interface/AclInterface.h b/torch_npu/csrc/core/npu/interface/AclInterface.h index c32cb0de6aad3480c02f7ead9e8f0334a6931a7a..01c873c4da0f2515d119dff48afdf6bbeec8187c 100644 --- a/torch_npu/csrc/core/npu/interface/AclInterface.h +++ b/torch_npu/csrc/core/npu/interface/AclInterface.h @@ -282,11 +282,5 @@ aclError AclrtUnuseStreamResInCurrentThread(); aclError AclrtGetResInCurrentThread(aclrtDevResModelType type, uint32_t* value); -/** - * This API is used to check whether aclrtGetResInCurrentThread exist - * Compatible CANN, delete in future -*/ -bool IsExistGetResInCurrentThread(); - } // namespace acl } // namespace c10_npu