From 581e596b10372dcc1248cffef21a93aebd0d1d48 Mon Sep 17 00:00:00 2001 From: SCh-zx <1325467101@qq.com> Date: Thu, 4 Sep 2025 10:07:56 +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 c97693eeb5..a7e81db1f2 100644 --- a/torch_npu/csrc/core/npu/interface/AclInterface.cpp +++ b/torch_npu/csrc/core/npu/interface/AclInterface.cpp @@ -1127,14 +1127,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