From 3bdf73f7d75dc47390e274487f62a3468fb8b4e8 Mon Sep 17 00:00:00 2001 From: SCh-zx <1325467101@qq.com> Date: Thu, 4 Sep 2025 10:08:10 +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 fd3ae1a137..ddee440632 100644 --- a/torch_npu/csrc/core/npu/interface/AclInterface.cpp +++ b/torch_npu/csrc/core/npu/interface/AclInterface.cpp @@ -1088,14 +1088,12 @@ aclError AclrtStreamGetId(aclrtStream stream, int32_t* stream_id) 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