1 /* 2 * Copyright (C) 2018-2021 Intel Corporation 3 * 4 * SPDX-License-Identifier: MIT 5 * 6 */ 7 8 #pragma once 9 #include "shared/source/gmm_helper/gmm_lib.h" 10 11 #include <memory> 12 13 namespace NEO { 14 class GmmClientContext; 15 class GmmMemoryBase { 16 public: 17 virtual ~GmmMemoryBase() = default; 18 19 MOCKABLE_VIRTUAL bool configureDeviceAddressSpace(GMM_ESCAPE_HANDLE hAdapter, 20 GMM_ESCAPE_HANDLE hDevice, 21 GMM_ESCAPE_FUNC_TYPE pfnEscape, 22 GMM_GFX_SIZE_T svmSize, 23 BOOLEAN bdwL3Coherency); 24 25 bool configureDevice(GMM_ESCAPE_HANDLE hAdapter, 26 GMM_ESCAPE_HANDLE hDevice, 27 GMM_ESCAPE_FUNC_TYPE pfnEscape, 28 GMM_GFX_SIZE_T svmSize, 29 BOOLEAN bdwL3Coherency, 30 uintptr_t &minAddress, 31 bool obtainMinAddress); 32 33 MOCKABLE_VIRTUAL uintptr_t getInternalGpuVaRangeLimit(); 34 35 MOCKABLE_VIRTUAL bool setDeviceInfo(GMM_DEVICE_INFO *deviceInfo); 36 37 protected: 38 GmmMemoryBase(GmmClientContext *gmmClientContext); 39 GMM_CLIENT_CONTEXT &clientContext; 40 }; 41 } // namespace NEO 42