SWDEV-294596 - Make hipModuleGetGlobal match cuda

Make hipModuleGetGlobal match cuModuleGetGlobal behavour.
That is, if one of the first two parameters is nullptr, ignore it.

Change-Id: I3fe6dbc35a7b14aa9119df297b7885df83d28048
Este commit está contenido en:
Tao Sang
2021-07-22 09:41:20 -04:00
cometido por Tao Sang
padre ba0220578e
commit b58355b065
+5 -2
Ver fichero
@@ -100,10 +100,13 @@ hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes, hipModule_t h
{
HIP_INIT_API(hipModuleGetGlobal, dptr, bytes, hmod, name);
if(dptr == nullptr || bytes == nullptr || name == nullptr) {
if (dptr == nullptr || bytes == nullptr) {
// If either is nullptr, ignore it
return hipSuccess;
}
if (name == nullptr) {
return hipErrorInvalidValue;
}
/* Get address and size for the global symbol */
if (hipSuccess != PlatformState::instance().getDynGlobalVar(name, hmod, dptr, bytes)) {
LogPrintfError("Cannot find global Var: %s for module: 0x%x at device: %d \n", name, hmod,