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