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


[ROCm/clr commit: b58355b065]
Этот коммит содержится в:
Tao Sang
2021-07-22 09:41:20 -04:00
коммит произвёл Tao Sang
родитель 969db71ffa
Коммит 46737b278a
+5 -2
Просмотреть файл
@@ -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,