mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 06:23:01 +08:00
Change createGmmContextWrapperFunc to return unique ptr
Change-Id: I74e6c5b1a49ed19f24933edd3062c62d9256f2d8
This commit is contained in:
committed by
sys_ocldev
parent
c5becf63f7
commit
df2f29907c
@@ -37,8 +37,8 @@ class GmmClientContextBase {
|
||||
MOCKABLE_VIRTUAL void destroyResInfoObject(GMM_RESOURCE_INFO *pResInfo);
|
||||
GMM_CLIENT_CONTEXT *getHandle() const;
|
||||
template <typename T>
|
||||
static GmmClientContext *create(GMM_CLIENT clientType) {
|
||||
return new T(clientType);
|
||||
static std::unique_ptr<GmmClientContext> create(GMM_CLIENT clientType) {
|
||||
return std::make_unique<T>(clientType);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -56,7 +56,7 @@ void GmmHelper::initContext(const PLATFORM *pPlatform,
|
||||
loadLib();
|
||||
bool success = GMM_SUCCESS == GmmHelper::initGlobalContextFunc(*pPlatform, &gmmFtrTable, &gmmWaTable, pGtSysInfo);
|
||||
UNRECOVERABLE_IF(!success);
|
||||
gmmClientContext.reset(GmmHelper::createGmmContextWrapperFunc(GMM_CLIENT::GMM_OCL_VISTA));
|
||||
gmmClientContext = GmmHelper::createGmmContextWrapperFunc(GMM_CLIENT::GMM_OCL_VISTA);
|
||||
UNRECOVERABLE_IF(!gmmClientContext);
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ GmmHelper::~GmmHelper() {
|
||||
GmmHelper::destroyGlobalContextFunc();
|
||||
};
|
||||
bool GmmHelper::useSimplifiedMocsTable = false;
|
||||
GmmClientContext *(*GmmHelper::createGmmContextWrapperFunc)(GMM_CLIENT) = GmmClientContextBase::create<GmmClientContext>;
|
||||
decltype(GmmHelper::createGmmContextWrapperFunc) GmmHelper::createGmmContextWrapperFunc = GmmClientContextBase::create<GmmClientContext>;
|
||||
|
||||
const HardwareInfo *GmmHelper::hwInfo = nullptr;
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -68,7 +68,7 @@ class GmmHelper {
|
||||
static decltype(GmmExportEntries::pfnCreateClientContext) createClientContextFunc;
|
||||
static decltype(GmmExportEntries::pfnDeleteClientContext) deleteClientContextFunc;
|
||||
|
||||
static GmmClientContext *(*createGmmContextWrapperFunc)(GMM_CLIENT);
|
||||
static std::unique_ptr<GmmClientContext> (*createGmmContextWrapperFunc)(GMM_CLIENT);
|
||||
|
||||
static bool useSimplifiedMocsTable;
|
||||
static const HardwareInfo *hwInfo;
|
||||
|
||||
Reference in New Issue
Block a user