mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
Use types of gmm dll functions in gmm interfaces
Change-Id: I91bd9563abbcde32a0c88066a2f6747c1d5abc81
This commit is contained in:
committed by
sys_ocldev
parent
8ed9991910
commit
8537c7f42f
@@ -29,12 +29,7 @@ extern const char *gmmEntryName;
|
||||
} // namespace Os
|
||||
|
||||
namespace OCLRT {
|
||||
GMM_STATUS(GMM_STDCALL *myPfnCreateSingletonContext)
|
||||
(const PLATFORM Platform, const void *pSkuTable, const void *pWaTable, const void *pGtSysInfo);
|
||||
GMM_STATUS GMM_STDCALL myGmmInitGlobalContext(const PLATFORM Platform, const SKU_FEATURE_TABLE *pSkuTable, const WA_TABLE *pWaTable, const GT_SYSTEM_INFO *pGtSysInfo, GMM_CLIENT ClientType) {
|
||||
return myPfnCreateSingletonContext(Platform, pSkuTable, pWaTable, pGtSysInfo);
|
||||
}
|
||||
decltype(GmmHelper::initGlobalContextFunc) GmmHelper::initGlobalContextFunc = &myGmmInitGlobalContext;
|
||||
decltype(GmmHelper::initGlobalContextFunc) GmmHelper::initGlobalContextFunc = nullptr;
|
||||
decltype(GmmHelper::destroyGlobalContextFunc) GmmHelper::destroyGlobalContextFunc = nullptr;
|
||||
decltype(GmmHelper::createClientContextFunc) GmmHelper::createClientContextFunc = nullptr;
|
||||
decltype(GmmHelper::deleteClientContextFunc) GmmHelper::deleteClientContextFunc = nullptr;
|
||||
@@ -48,11 +43,11 @@ void GmmHelper::loadLib() {
|
||||
GmmExportEntries entries;
|
||||
auto status = openGmmFunc(&entries);
|
||||
if (status == GMM_SUCCESS) {
|
||||
myPfnCreateSingletonContext = entries.pfnCreateSingletonContext;
|
||||
GmmHelper::initGlobalContextFunc = entries.pfnCreateSingletonContext;
|
||||
GmmHelper::destroyGlobalContextFunc = entries.pfnDestroySingletonContext;
|
||||
GmmHelper::createClientContextFunc = entries.pfnCreateClientContext;
|
||||
GmmHelper::deleteClientContextFunc = entries.pfnDeleteClientContext;
|
||||
isLoaded = myPfnCreateSingletonContext && GmmHelper::destroyGlobalContextFunc && GmmHelper::createClientContextFunc && GmmHelper::deleteClientContextFunc;
|
||||
isLoaded = GmmHelper::initGlobalContextFunc && GmmHelper::destroyGlobalContextFunc && GmmHelper::createClientContextFunc && GmmHelper::deleteClientContextFunc;
|
||||
}
|
||||
}
|
||||
UNRECOVERABLE_IF(!isLoaded);
|
||||
|
||||
Reference in New Issue
Block a user