Add lock to addFatBinary and removeFatBinary

In case hipModule(Un)Load is called from different thread as hipInit we need to grab the lock
as both are going to modify modules_
Also add some logging for __hipExtractCodeObjectFromFatBinary in case binary isn't found for GPU
SWDEV-236032

Change-Id: Icbd72b412502df80d5066cea42a4fbcd5b0b8a98
Этот коммит содержится в:
Christophe Paquot
2020-05-12 15:51:52 -07:00
родитель da01762f1a
Коммит f100ae3679
2 изменённых файлов: 6 добавлений и 2 удалений
+4 -2
Просмотреть файл
@@ -122,10 +122,12 @@ hipError_t __hipExtractCodeObjectFromFatBinary(const void* data,
num_code_objs++;
}
}
if (num_code_objs == devices.size())
if (num_code_objs == devices.size()) {
return hipSuccess;
else
} else {
DevLogError("hipErrorNoBinaryForGpu: Coudn't find binary for current devices!");
return hipErrorNoBinaryForGpu;
}
}
extern "C" std::vector<std::pair<hipModule_t, bool>>* __hipRegisterFatBinary(const void* data)