performance: Optimize heap handling when mitigate dc flush

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2024-09-05 14:13:40 +00:00
committed by Compute-Runtime-Automation
parent 915ff42566
commit a54a3bf624
15 changed files with 70 additions and 14 deletions

View File

@@ -79,6 +79,17 @@ void CommandList::removeHostPtrAllocations() {
hostPtrMap.clear();
}
void CommandList::forceDcFlushForDcFlushMitigation() {
if (this->device && this->device->getProductHelper().isDcFlushMitigated()) {
for (const auto &engine : this->device->getNEODevice()->getMemoryManager()->getRegisteredEngines(this->device->getNEODevice()->getRootDeviceIndex())) {
if (engine.commandStreamReceiver->isDirectSubmissionEnabled()) {
engine.commandStreamReceiver->registerDcFlushForDcMitigation();
engine.commandStreamReceiver->flushTagUpdate();
}
}
}
}
void CommandList::removeMemoryPrefetchAllocations() {
if (this->performMemoryPrefetch) {
auto prefetchManager = this->device->getDriverHandle()->getMemoryManager()->getPrefetchManager();

View File

@@ -200,6 +200,8 @@ struct CommandList : _ze_command_list_handle_t {
return commandListPerThreadScratchSize[slotId];
}
void forceDcFlushForDcFlushMitigation();
void setOrdinal(uint32_t ord) { ordinal = ord; }
void setCommandListPerThreadScratchSize(uint32_t slotId, uint32_t size) {
UNRECOVERABLE_IF(slotId > 1);

View File

@@ -157,6 +157,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::reset() {
this->inOrderPatchCmds.clear();
this->forceDcFlushForDcFlushMitigation();
return ZE_RESULT_SUCCESS;
}

View File

@@ -76,6 +76,8 @@ ze_result_t CommandListImp::destroy() {
}
}
this->forceDcFlushForDcFlushMitigation();
delete this;
return ZE_RESULT_SUCCESS;
}