From 76dc2e3c9b7ac36ffbde81e2f91f4e1e39e138ad Mon Sep 17 00:00:00 2001 From: kjayapra-amd Date: Fri, 22 May 2020 18:06:37 -0400 Subject: [PATCH] SWDEV - 237467 - Return proper hip error codes incase of ROCclr IPC API failures. Change-Id: I2cc8da543f70bb3d8b82520fa9b2f509d20ce3c0 [ROCm/clr commit: 6bc01b31d68a04f6a4b4d12ccfbf5e61d032b5a6] --- projects/clr/hipamd/rocclr/hip_memory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/rocclr/hip_memory.cpp b/projects/clr/hipamd/rocclr/hip_memory.cpp index be35c40ad8..b7b8d77592 100755 --- a/projects/clr/hipamd/rocclr/hip_memory.cpp +++ b/projects/clr/hipamd/rocclr/hip_memory.cpp @@ -1962,7 +1962,10 @@ hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* dev_ptr) { /* Create an handle for IPC. Store the memory size inside the handle */ ihandle = reinterpret_cast(handle); - dev_mem_obj->IpcCreate(offset, &(ihandle->psize), &(ihandle->ipc_handle)); + if(!dev_mem_obj->IpcCreate(offset, &(ihandle->psize), &(ihandle->ipc_handle))) { + DevLogPrintfError("IPC memory creation failed for memory: 0x%x", dev_ptr); + HIP_RETURN(hipErrorInvalidValue); + } HIP_RETURN(hipSuccess); }