fix: chunking prefetch add USER_FENCE

Add USER_FENCE before PREFETCH call and after the BIND

Related-To: NEO-8098

Signed-off by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:
John Falkowski
2023-08-14 16:31:23 +00:00
committed by Compute-Runtime-Automation
parent f43e6cc795
commit 2403212dcd
12 changed files with 203 additions and 12 deletions

View File

@@ -182,7 +182,11 @@ bool DrmAllocation::setCacheAdvice(Drm *drm, size_t regionSize, CacheRegion regi
return true;
}
int DrmAllocation::prefetchBOWithChunking(Drm *drm) {
bool DrmAllocation::prefetchBOWithChunking(Drm *drm) {
if (!(NEO::DebugManager.flags.EnableBOChunkingPrefetch.get())) {
return false;
}
auto getSubDeviceIds = [](const DeviceBitfield &subDeviceBitfield) {
SubDeviceIdsVec subDeviceIds;
for (auto subDeviceId = 0u; subDeviceId < subDeviceBitfield.size(); subDeviceId++) {

View File

@@ -124,7 +124,7 @@ class DrmAllocation : public GraphicsAllocation {
this->osContext = context;
}
int prefetchBOWithChunking(Drm *drm);
bool prefetchBOWithChunking(Drm *drm);
MOCKABLE_VIRTUAL int makeBOsResident(OsContext *osContext, uint32_t vmHandleId, std::vector<BufferObject *> *bufferObjects, bool bind);
MOCKABLE_VIRTUAL int bindBO(BufferObject *bo, OsContext *osContext, uint32_t vmHandleId, std::vector<BufferObject *> *bufferObjects, bool bind);
MOCKABLE_VIRTUAL int bindBOs(OsContext *osContext, uint32_t vmHandleId, std::vector<BufferObject *> *bufferObjects, bool bind);

View File

@@ -65,12 +65,6 @@ MemoryOperationsStatus DrmMemoryOperationsHandlerBind::makeResidentWithinOsConte
}
}
if (bo->isChunked) {
auto memoryManager = static_cast<DrmMemoryManager *>(this->rootDeviceEnvironment.executionEnvironment.memoryManager.get());
auto drm = &memoryManager->getDrm(drmAllocation->getRootDeviceIndex());
drmAllocation->prefetchBOWithChunking(drm);
}
if (!evictable) {
drmAllocation->updateResidencyTaskCount(GraphicsAllocation::objectAlwaysResident, osContext->getContextId());
}