Reorganization directory structure [3/n]

Change-Id: If3dfa3f6007f8810a6a1ae1a4f0c7da38544648d
This commit is contained in:
kamdiedrich
2020-02-23 21:00:51 +01:00
committed by sys_ocldev
parent e177b4fc0f
commit e072275ae6
711 changed files with 94 additions and 94 deletions

View File

@@ -0,0 +1,14 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "gmm_memory.h"
namespace NEO {
GmmMemory *GmmMemory::create(GmmClientContext *gmmClientContext) {
return new GmmMemory(gmmClientContext);
}
} // namespace NEO

View File

@@ -0,0 +1,20 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "gmm_helper/windows/gmm_memory_base.h"
namespace NEO {
class GmmMemory : public GmmMemoryBase {
public:
static GmmMemory *create(GmmClientContext *gmmClientContext);
virtual ~GmmMemory() = default;
protected:
using GmmMemoryBase::GmmMemoryBase;
};
} // namespace NEO

View File

@@ -0,0 +1,58 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "gmm_helper/windows/gmm_memory_base.h"
#include "helpers/debug_helpers.h"
#include "os_interface/windows/windows_defs.h"
#include "gmm_client_context.h"
namespace NEO {
GmmMemoryBase::GmmMemoryBase(GmmClientContext *gmmClientContext) : clientContext(*gmmClientContext->getHandle()) {
}
bool GmmMemoryBase::configureDeviceAddressSpace(GMM_ESCAPE_HANDLE hAdapter,
GMM_ESCAPE_HANDLE hDevice,
GMM_ESCAPE_FUNC_TYPE pfnEscape,
GMM_GFX_SIZE_T SvmSize,
BOOLEAN BDWL3Coherency) {
return clientContext.ConfigureDeviceAddressSpace(
{hAdapter},
{hDevice},
{pfnEscape},
SvmSize,
0,
0,
BDWL3Coherency,
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,
uintptr_t &minAddress,
bool obtainMinAddress) {
minAddress = windowsMinAddress;
auto retVal = configureDeviceAddressSpace(hAdapter, hDevice, pfnEscape, SvmSize, BDWL3Coherency);
if (obtainMinAddress) {
minAddress = getInternalGpuVaRangeLimit();
}
return retVal;
}
uintptr_t GmmMemoryBase::getInternalGpuVaRangeLimit() {
return static_cast<uintptr_t>(clientContext.GetInternalGpuVaRangeLimit());
}
bool GmmMemoryBase::setDeviceInfo(GMM_DEVICE_INFO *deviceInfo) {
auto status = clientContext.GmmSetDeviceInfo(deviceInfo);
DEBUG_BREAK_IF(status != GMM_SUCCESS);
return GMM_SUCCESS == status;
}
}; // namespace NEO

View File

@@ -0,0 +1,41 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "gmm_helper/gmm_lib.h"
#include <memory>
namespace NEO {
class GmmClientContext;
class GmmMemoryBase {
public:
virtual ~GmmMemoryBase() = default;
MOCKABLE_VIRTUAL bool configureDeviceAddressSpace(GMM_ESCAPE_HANDLE hAdapter,
GMM_ESCAPE_HANDLE hDevice,
GMM_ESCAPE_FUNC_TYPE pfnEscape,
GMM_GFX_SIZE_T SvmSize,
BOOLEAN BDWL3Coherency);
bool configureDevice(GMM_ESCAPE_HANDLE hAdapter,
GMM_ESCAPE_HANDLE hDevice,
GMM_ESCAPE_FUNC_TYPE pfnEscape,
GMM_GFX_SIZE_T SvmSize,
BOOLEAN BDWL3Coherency,
uintptr_t &minAddress,
bool obtainMinAddress);
MOCKABLE_VIRTUAL uintptr_t getInternalGpuVaRangeLimit();
MOCKABLE_VIRTUAL bool setDeviceInfo(GMM_DEVICE_INFO *deviceInfo);
protected:
GmmMemoryBase(GmmClientContext *gmmClientContext);
GMM_CLIENT_CONTEXT &clientContext;
};
} // namespace NEO