diff --git a/torch_npu/csrc/core/npu/interface/AclInterface.cpp b/torch_npu/csrc/core/npu/interface/AclInterface.cpp index fdf6abe75336ff571d450a585386cfc8028ba8c6..a5822e094088543e712ef3840c7392e33c208fc4 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; }