2018-05-06 03:30:37 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
2018-09-18 15:11:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2018-05-06 03:30:37 +08:00
|
|
|
|
|
|
|
#include "runtime/gmm_helper/gmm_helper.h"
|
|
|
|
#include "runtime/gmm_helper/page_table_mngr.h"
|
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "gmm_client_context.h"
|
|
|
|
|
2018-05-06 03:30:37 +08:00
|
|
|
namespace OCLRT {
|
2018-07-03 16:00:12 +08:00
|
|
|
GmmPageTableMngr::~GmmPageTableMngr() {
|
|
|
|
if (clientContext) {
|
|
|
|
clientContext->DestroyPageTblMgrObject(pageTableManager);
|
|
|
|
}
|
2018-05-06 03:30:37 +08:00
|
|
|
}
|
|
|
|
|
2018-05-17 17:47:35 +08:00
|
|
|
GmmPageTableMngr::GmmPageTableMngr(GMM_DEVICE_CALLBACKS_INT *deviceCb, unsigned int translationTableFlags, GMM_TRANSLATIONTABLE_CALLBACKS *translationTableCb) {
|
2018-07-23 18:23:48 +08:00
|
|
|
clientContext = GmmHelper::getClientContext()->getHandle();
|
2018-07-03 16:00:12 +08:00
|
|
|
pageTableManager = clientContext->CreatePageTblMgrObject(deviceCb, translationTableCb, translationTableFlags);
|
2018-05-06 03:30:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace OCLRT
|