feature: Implement appendMemoryPrefetch for Shared System USM Allocations

Related-To: NEO-12989

Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:
John Falkowski
2025-03-11 02:59:53 +00:00
committed by Compute-Runtime-Automation
parent 642bdd122e
commit 97799b3faf
29 changed files with 583 additions and 143 deletions

View File

@@ -300,6 +300,16 @@ bool DrmMemoryManager::setAtomicAccess(GraphicsAllocation *gfxAllocation, size_t
return drmAllocation->setAtomicAccess(&this->getDrm(rootDeviceIndex), size, mode);
}
bool DrmMemoryManager::prefetchSharedSystemAlloc(const void *ptr, const size_t size, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) {
auto &drm = this->getDrm(rootDeviceIndex);
auto ioctlHelper = drm.getIoctlHelper();
auto memoryClassDevice = ioctlHelper->getDrmParamValue(DrmParam::memoryClassDevice);
auto region = static_cast<uint32_t>((memoryClassDevice << 16u) | subDeviceIds[0]);
auto vmId = drm.getVirtualMemoryAddressSpace(subDeviceIds[0]);
return ioctlHelper->setVmPrefetch(reinterpret_cast<uint64_t>(ptr), size, region, vmId);
}
bool DrmMemoryManager::setMemPrefetch(GraphicsAllocation *gfxAllocation, SubDeviceIdsVec &subDeviceIds, uint32_t rootDeviceIndex) {
auto drmAllocation = static_cast<DrmAllocation *>(gfxAllocation);
auto osContextLinux = getDefaultOsContext(rootDeviceIndex);