From 7002be9c950825c9e67d3402732cc03caf974bb2 Mon Sep 17 00:00:00 2001 From: kjayapra-amd Date: Wed, 27 May 2020 18:02:47 -0400 Subject: [PATCH] SWDEV-236465 - Return error code as soon as global creation fails. Change-Id: I790b8b4fdd6ab8818bc5b6b9a79e6900b840372d [ROCm/hip commit: db972c4f2ab5361d46981983243fa2412f590a9e] --- projects/hip/rocclr/hip_platform.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/hip/rocclr/hip_platform.cpp b/projects/hip/rocclr/hip_platform.cpp index 5f5d1e74c9..070a1082d5 100755 --- a/projects/hip/rocclr/hip_platform.cpp +++ b/projects/hip/rocclr/hip_platform.cpp @@ -442,10 +442,10 @@ hipFunction_t PlatformState::getFunc(const void* hostFunction, int deviceId) { if (createFunc(&function, module, devFunc.deviceName.c_str()) && function != nullptr) { devFunc.functions[deviceId] = function; - } - else { - // tprintf(DB_FB, "__hipRegisterFunction cannot find kernel %s for" - // " device %d\n", deviceName, deviceId); + } else { + DevLogPrintfError("__hipRegisterFunction cannot find kernel %s for device %d\n", + devFunc.deviceName.c_str(), deviceId); + return nullptr; } } return devFunc.functions[deviceId]; @@ -547,7 +547,9 @@ bool PlatformState::getGlobalVar(const char* hostVar, int deviceId, hipModule_t dvar->rvars[deviceId].amd_mem_obj_ = amd_mem_obj; amd::MemObjMap::AddMemObj(device_ptr, amd_mem_obj); } else { - LogError("__hipRegisterVar cannot find kernel for device \n"); + DevLogPrintfError("__hipRegisterVar cannot find Var: %s for deviceId: 0x%x \n", + dvar->hostVar.c_str(), deviceId); + return false; } } *size_ptr = dvar->rvars[deviceId].getvarsize();