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
This commit is contained in:
Rakesh Roy
2023-08-03 19:55:31 +05:30
committed by Rakesh Roy
parent c1126fc727
commit 76c8b3157b
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -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));