rocr/dtif: add CreateThunkInstance/DestroyThunkInstance interfaces

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: David Yat Sin <David.YatSin@amd.com>
This commit is contained in:
Aaron Liu
2024-12-19 15:49:37 +08:00
کامیت شده توسط Yat Sin, David
والد 0cd4ddd62b
کامیت e9088d6e47
3فایلهای تغییر یافته به همراه44 افزوده شده و 0 حذف شده
@@ -485,5 +485,37 @@ ERROR:
}
}
bool ThunkLoader::CreateThunkInstance() {
if (!core::Runtime::runtime_singleton_->flag().enable_dtif())
return true;
DtifCreateFunc* pfnDtifCreate = (DtifCreateFunc*)dlsym(dtif_handle, "DtifCreate");
if (pfnDtifCreate != NULL) {
if (pfnDtifCreate("HSA") != NULL) {
debug_print("DtifCreate OK!\n");
return true;
} else {
debug_print("DtifCreate failed!\n");
return false;
}
}
return false;
}
bool ThunkLoader::DestroyThunkInstance() {
if (!core::Runtime::runtime_singleton_->flag().enable_dtif())
return true;
if (dtif_handle == NULL)
return false;
DtifDestroyFunc* pfnDtifDestroy = (DtifDestroyFunc*)dlsym(dtif_handle, "DtifDestroy");
if (pfnDtifDestroy != NULL) {
pfnDtifDestroy();
debug_print("DtifDestroy OK!\n");
return true;
}
return false;
}
} // namespace core
} // namespace rocr