Gmm interface update

- Use local gmmClientContext instead of pGMMGlobalContext
- ResourceInfo and PTmanager creation from gmmClientContext
- Mock Gmm context creation in Wddm to have only one instance per run

Change-Id: I67e015c57f0ab5524564760fd9a849615615697f
This commit is contained in:
Dunajski, Bartosz
2018-05-05 21:30:37 +02:00
committed by sys_ocldev
parent 231ad7cfd9
commit 46003145e9
15 changed files with 247 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -23,11 +23,12 @@
#pragma once
#include "runtime/gmm_helper/gmm_lib.h"
#include <memory>
#include <functional>
namespace OCLRT {
class GmmPageTableMngr {
public:
virtual ~GmmPageTableMngr() = default;
MOCKABLE_VIRTUAL ~GmmPageTableMngr() = default;
static GmmPageTableMngr *create(GMM_DEVICE_CALLBACKS *deviceCb, unsigned int translationTableFlags, GMM_TRANSLATIONTABLE_CALLBACKS *translationTableCb);
@@ -44,12 +45,13 @@ class GmmPageTableMngr {
}
protected:
static void customDeleter(GMM_PAGETABLE_MGR *gmmPageTableManager);
using UniquePtrType = std::unique_ptr<GMM_PAGETABLE_MGR, std::function<void(GMM_PAGETABLE_MGR *)>>;
GmmPageTableMngr() = default;
GmmPageTableMngr(GMM_DEVICE_CALLBACKS *deviceCb, unsigned int translationTableFlags, GMM_TRANSLATIONTABLE_CALLBACKS *translationTableCb) {
pageTableManager.reset(new GMM_PAGETABLE_MGR(deviceCb, translationTableFlags, translationTableCb));
}
GmmPageTableMngr(GMM_DEVICE_CALLBACKS *deviceCb, unsigned int translationTableFlags, GMM_TRANSLATIONTABLE_CALLBACKS *translationTableCb);
std::unique_ptr<GMM_PAGETABLE_MGR> pageTableManager;
UniquePtrType pageTableManager;
};
} // namespace OCLRT