diff --git a/torch_npu/csrc/core/npu/NPUStream.cpp b/torch_npu/csrc/core/npu/NPUStream.cpp index 45ccdd5bec618fad9214de7f0c0c2989732cbe09..8fb57e7707b212f4a653faa3b72c93eb12d6c9a3 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 6eac15e3cfcb2500a760d846d783629ecf64c2c8..90dac9020fa24c7f08c2cdc64b3234d4a1bfc80c 100644 --- a/torch_npu/csrc/core/npu/interface/AclInterface.cpp +++ b/torch_npu/csrc/core/npu/interface/AclInterface.cpp @@ -1226,12 +1226,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