SWDEV-415265 - Fix segfault when library isn't built with current GPU arch

- Return error code instead of segfault during kernel launch when library isn't built with current gpu arch
- Fix string print bug

Change-Id: I91aaa50150fee220317cd2eb4e075d825cc448b2


[ROCm/clr commit: 76c8b3157b]
This commit is contained in:
Rakesh Roy
2023-08-03 19:55:31 +05:30
کامیت شده توسط Rakesh Roy
والد 7792716dcf
کامیت b3e340eb5d
2فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
@@ -128,6 +128,10 @@ hipError_t Function::getDynFunc(hipFunction_t* hfunc, hipModule_t hmod) {
hipError_t Function::getStatFunc(hipFunction_t* hfunc, int deviceId) {
guarantee(modules_ != nullptr, "Module not initialized");
if (dFunc_.size() != g_devices.size()) {
return hipErrorSharedObjectInitFailed;
}
hipModule_t hmod = nullptr;
IHIP_RETURN_ONFAIL((*modules_)->BuildProgram(deviceId));
IHIP_RETURN_ONFAIL((*modules_)->GetModule(deviceId, &hmod));