From a08ddb4b53c4e1e2b32485ea18f0d226b1501bb3 Mon Sep 17 00:00:00 2001 From: Sarbojit Sarkar Date: Fri, 20 Nov 2020 02:46:37 -0500 Subject: [PATCH] SWDEV-258579: hipMemcpy2D better error handling Change-Id: I09378d6e31da99451e22cbe9276a5ff1ad4a1840 --- hipamd/rocclr/hip_memory.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/hipamd/rocclr/hip_memory.cpp b/hipamd/rocclr/hip_memory.cpp index bdde2e4e36..00854dbde4 100755 --- a/hipamd/rocclr/hip_memory.cpp +++ b/hipamd/rocclr/hip_memory.cpp @@ -1098,13 +1098,16 @@ hipError_t ihipMemcpyDtoD(void* srcDevice, return hipErrorOutOfMemory; } + hipError_t status = hipSuccess; command->enqueue(); if (!isAsync) { - command->awaitCompletion(); + if (!command->awaitCompletion()) { + status = hipErrorUnknown; + } } command->release(); - return hipSuccess; + return status; } hipError_t ihipMemcpyDtoH(void* srcDevice, @@ -1157,13 +1160,16 @@ hipError_t ihipMemcpyDtoH(void* srcDevice, return hipErrorOutOfMemory; } + hipError_t status = hipSuccess; command->enqueue(); if (!isAsync) { - command->awaitCompletion(); + if (!command->awaitCompletion()) { + status = hipErrorUnknown; + } } command->release(); - return hipSuccess; + return status; } hipError_t ihipMemcpyHtoD(const void* srcHost, @@ -1216,13 +1222,16 @@ hipError_t ihipMemcpyHtoD(const void* srcHost, return hipErrorOutOfMemory; } + hipError_t status = hipSuccess; command->enqueue(); if (!isAsync) { - command->awaitCompletion(); + if (!command->awaitCompletion()) { + status = hipErrorUnknown; + } } command->release(); - return hipSuccess; + return status; } hipError_t ihipMemcpyHtoH(const void* srcHost,