SWDEV-251091: Added null checks and empty file check in hip_module and hip_platform

Change-Id: Iad99f996dcf90ffb86f62e79bf4cbd53b35b7e3b
Этот коммит содержится в:
Sourabh Betigeri
2020-10-13 01:19:47 -07:00
коммит произвёл Sourabh Betigeri
родитель 5fec831e1c
Коммит 3c4208aa7d
4 изменённых файлов: 23 добавлений и 4 удалений
+5 -1
Просмотреть файл
@@ -11,7 +11,7 @@
namespace hip {
uint64_t CodeObject::ElfSize(const void *emi) {
return amd::Elf::getElfSize(emi);
return amd::Elf::getElfSize(emi);
}
bool CodeObject::isCompatibleCodeObject(const std::string& codeobj_target_id,
@@ -180,6 +180,10 @@ hipError_t DynCO::getDynFunc(hipFunction_t* hfunc, std::string func_name) {
CheckDeviceIdMatch();
if(hfunc == nullptr) {
return hipErrorInvalidValue;
}
auto it = functions_.find(func_name);
if (it == functions_.end()) {
DevLogPrintfError("Cannot find the function: %s ", func_name.c_str());