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 693934e8ac84f6b6c125b9a47e597abf629af18c..cb6286b62899373639bb36fd6ad8f5ee51652733 100644 --- a/torch_npu/csrc/core/npu/interface/AclInterface.cpp +++ b/torch_npu/csrc/core/npu/interface/AclInterface.cpp @@ -1188,12 +1188,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 3d542c75a3a854c921526a776a72a9b18a805271..b4ede8dea1ae0df4528e504381f83590911ec06c 100644 --- a/torch_npu/csrc/core/npu/interface/AclInterface.h +++ b/torch_npu/csrc/core/npu/interface/AclInterface.h @@ -276,11 +276,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