mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Related-To: NEO-4942 Change-Id: I9f8c3a5aa4d3dee57595ac287df64d8c9b41a9cb Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2018-2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "mock_gmm_client_context.h"
|
|
|
|
namespace NEO {
|
|
MockGmmClientContext::MockGmmClientContext(OSInterface *osInterface, HardwareInfo *hwInfo) : MockGmmClientContextBase(osInterface, hwInfo) {
|
|
}
|
|
|
|
MEMORY_OBJECT_CONTROL_STATE MockGmmClientContextBase::cachePolicyGetMemoryObject(GMM_RESOURCE_INFO *pResInfo, GMM_RESOURCE_USAGE_TYPE usage) {
|
|
MEMORY_OBJECT_CONTROL_STATE retVal = {};
|
|
memset(&retVal, 0, sizeof(MEMORY_OBJECT_CONTROL_STATE));
|
|
switch (usage) {
|
|
case GMM_RESOURCE_USAGE_OCL_INLINE_CONST_HDC:
|
|
retVal.DwordValue = 32u;
|
|
break;
|
|
case GMM_RESOURCE_USAGE_OCL_BUFFER:
|
|
retVal.DwordValue = 16u;
|
|
break;
|
|
case GMM_RESOURCE_USAGE_OCL_BUFFER_CONST:
|
|
retVal.DwordValue = 8u;
|
|
break;
|
|
case GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED:
|
|
retVal.DwordValue = 0u;
|
|
break;
|
|
case GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER:
|
|
retVal.DwordValue = 2u;
|
|
break;
|
|
default:
|
|
retVal.DwordValue = 4u;
|
|
break;
|
|
}
|
|
return retVal;
|
|
}
|
|
|
|
} // namespace NEO
|