Access GmmHelper and GmmClientContext via RootDeviceEnvironment

Related-To: NEO-3857
Change-Id: Ie9d719c9884fd89580ce3592a0d4d4cd42862f47
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-02-24 18:04:30 +01:00
committed by sys_ocldev
parent 4a41c9741c
commit 74072d4916
60 changed files with 234 additions and 184 deletions

View File

@ -586,6 +586,7 @@ Buffer *Buffer::createBufferHwFromDevice(const Device *device,
zeroCopy, isHostPtrSVM, isImageRedescribed);
pBuffer->offset = offset;
pBuffer->executionEnvironment = device->getExecutionEnvironment();
pBuffer->rootDeviceEnvironment = pBuffer->executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()].get();
return pBuffer;
}
@ -605,7 +606,7 @@ uint32_t Buffer::getMocsValue(bool disableL3Cache, bool isReadOnlyArgument) cons
bool alignedMemObj = isAligned<MemoryConstants::cacheLineSize>(bufferAddress) &&
isAligned<MemoryConstants::cacheLineSize>(bufferSize);
auto gmmHelper = executionEnvironment->getGmmHelper();
auto gmmHelper = rootDeviceEnvironment->getGmmHelper();
if (!disableL3Cache && !isMemObjUncacheableForSurfaceState() && (alignedMemObj || readOnlyMemObj || !isMemObjZeroCopy())) {
return gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER);
} else {