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 f7da54b59ef5a5a53a76ebdb8204c07e6f42fcfb..a82c8016ebffc6d271df0dc89a7432c62438eb59 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 0d20f91faa95650e8bdb9680d5efcf0c0f5265f4..efa6204259e4f5de2c329a9ff6f3b83a9c05cf92 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