diff --git a/operator/LeakyReluCustomSample/FrameworkLaunch/AclNNInvocation/src/main.cpp b/operator/LeakyReluCustomSample/FrameworkLaunch/AclNNInvocation/src/main.cpp index a1fccee3ac96652e961f18da07a19935ca6684ee..1c204f671d30edf03a975173e5a3e1daab80aaf6 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; }