From 8779b2fd080db411e9d451c81b6b153f921d746f Mon Sep 17 00:00:00 2001 From: SCh-zx <1325467101@qq.com> Date: Thu, 4 Sep 2025 10:07:49 +0000 Subject: [PATCH] update torch_npu/csrc/core/npu/interface/AclInterface.cpp. Signed-off-by: SCh-zx <1325467101@qq.com> --- torch_npu/csrc/core/npu/interface/AclInterface.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/torch_npu/csrc/core/npu/interface/AclInterface.cpp b/torch_npu/csrc/core/npu/interface/AclInterface.cpp index 90e6f8ca821..1ca820dba6b 100644 --- a/torch_npu/csrc/core/npu/interface/AclInterface.cpp +++ b/torch_npu/csrc/core/npu/interface/AclInterface.cpp @@ -1126,14 +1126,12 @@ aclError AclrtUnSubscribeReport(uint64_t theadId, aclrtStream stream) bool AclrtMemcpyAsyncWithConditionExist() { const static bool isAclrtMemcpyAsyncWithConditionExist = []() -> bool { - auto func = GET_FUNC(aclrtMemcpyAsyncWithCondition) - bool flag = c10_npu::GetSocVersion() >= c10_npu::SocVersion::Ascend910B1 ? true : false; + auto func = GET_FUNC(aclrtMemcpyAsyncWithCondition); if (func != nullptr) { ASCEND_LOGI("Successfully to find function aclrtMemcpyAsyncWithCondition"); - } else { - flag = false; + return c10_npu::GetSocVersion() >= c10_npu::SocVersion::Ascend910B1; } - return flag; + return false; }(); return isAclrtMemcpyAsyncWithConditionExist; } -- Gitee