From 97cd3ed226effb72fee068d4c5c00deb430e0a2a Mon Sep 17 00:00:00 2001 From: yy0131 <1595992831@qq.com> Date: Fri, 20 Oct 2023 14:51:40 +0800 Subject: [PATCH] m --- .../FrameworkLaunch/AclNNInvocation/src/main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/operator/LeakyReluCustomSample/FrameworkLaunch/AclNNInvocation/src/main.cpp b/operator/LeakyReluCustomSample/FrameworkLaunch/AclNNInvocation/src/main.cpp index a1fccee3a..1c204f671 100644 --- a/operator/LeakyReluCustomSample/FrameworkLaunch/AclNNInvocation/src/main.cpp +++ b/operator/LeakyReluCustomSample/FrameworkLaunch/AclNNInvocation/src/main.cpp @@ -244,18 +244,19 @@ bool ExecuteOp() void *workspace = nullptr; if (workspaceSize != 0) { - if (aclrtMalloc(&workspace, workspaceSize, ACL_MEM_MALLOC_NORMAL_ONLY) != ACL_SUCCESS) { + ret = aclrtMalloc(&workspace, workspaceSize, ACL_MEM_MALLOC_NORMAL_ONLY); + if (ret != ACL_SUCCESS) { ERROR_LOG("Malloc device memory failed"); } } - - if (aclnnLeakyReluCustom(workspace, workspaceSize, handle, stream) != ACL_SUCCESS) { + ret = aclnnLeakyReluCustom(workspace, workspaceSize, handle, stream); + if (ret != ACL_SUCCESS) { ERROR_LOG("Execute Operator failed. error code is %d", static_cast(ret)); return false; } INFO_LOG("Execute aclnnLeakyReluCustom success"); - - if (aclrtSynchronizeStreamWithTimeout(stream, 5000) != SUCCESS) { + ret = aclrtSynchronizeStreamWithTimeout(stream, 5000); + if (ret != SUCCESS) { ERROR_LOG("Synchronize stream failed. error code is %d", static_cast(ret)); return false; } -- Gitee