From b44ae437bc999bd2112a95b07505ed4463288912 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 --- rocclr/hip_memory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rocclr/hip_memory.cpp b/rocclr/hip_memory.cpp index be35c40ad8..b7b8d77592 100755 --- a/rocclr/hip_memory.cpp +++ b/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); }