2018-05-06 03:30:37 +08:00
|
|
|
/*
|
2018-09-18 15:11:08 +08:00
|
|
|
* Copyright (C) 2018 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2018-05-06 03:30:37 +08:00
|
|
|
|
2018-07-06 15:07:42 +08:00
|
|
|
#include "gmm_client_context.h"
|
2018-05-06 03:30:37 +08:00
|
|
|
#include "runtime/gmm_helper/gmm_memory_base.h"
|
|
|
|
#include "runtime/gmm_helper/gmm_helper.h"
|
2018-08-23 17:29:39 +08:00
|
|
|
#include "runtime/os_interface/windows/windows_defs.h"
|
2018-05-06 03:30:37 +08:00
|
|
|
|
|
|
|
namespace OCLRT {
|
2018-07-23 16:06:00 +08:00
|
|
|
GmmMemoryBase::GmmMemoryBase() {
|
2018-07-23 18:23:48 +08:00
|
|
|
clientContext = GmmHelper::getClientContext()->getHandle();
|
2018-07-03 16:00:12 +08:00
|
|
|
}
|
2018-05-06 03:30:37 +08:00
|
|
|
bool GmmMemoryBase::configureDeviceAddressSpace(GMM_ESCAPE_HANDLE hAdapter,
|
|
|
|
GMM_ESCAPE_HANDLE hDevice,
|
|
|
|
GMM_ESCAPE_FUNC_TYPE pfnEscape,
|
|
|
|
GMM_GFX_SIZE_T SvmSize,
|
2018-08-23 17:29:39 +08:00
|
|
|
BOOLEAN BDWL3Coherency) {
|
2018-07-03 16:00:12 +08:00
|
|
|
return clientContext->ConfigureDeviceAddressSpace(
|
2018-05-06 03:30:37 +08:00
|
|
|
{hAdapter},
|
|
|
|
{hDevice},
|
|
|
|
{pfnEscape},
|
|
|
|
SvmSize,
|
2018-08-23 17:29:39 +08:00
|
|
|
0,
|
|
|
|
0,
|
2018-05-06 03:30:37 +08:00
|
|
|
BDWL3Coherency,
|
2018-08-23 17:29:39 +08:00
|
|
|
0,
|
|
|
|
0) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GmmMemoryBase::configureDevice(GMM_ESCAPE_HANDLE hAdapter,
|
|
|
|
GMM_ESCAPE_HANDLE hDevice,
|
|
|
|
GMM_ESCAPE_FUNC_TYPE pfnEscape,
|
|
|
|
GMM_GFX_SIZE_T SvmSize,
|
|
|
|
BOOLEAN BDWL3Coherency,
|
|
|
|
GMM_GFX_PARTITIONING &gfxPartition,
|
|
|
|
uintptr_t &minAddress) {
|
|
|
|
minAddress = windowsMinAddress;
|
|
|
|
return configureDeviceAddressSpace(hAdapter, hDevice, pfnEscape, SvmSize, BDWL3Coherency);
|
2018-05-06 03:30:37 +08:00
|
|
|
}
|
|
|
|
}; // namespace OCLRT
|