feature: synchronize patch preamble with wait commands before patching

Related-To: NEO-16140

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2025-09-17 11:30:29 +00:00
committed by Compute-Runtime-Automation
parent 8ab463f47c
commit 0b65b86ccb
9 changed files with 214 additions and 25 deletions

View File

@@ -43,11 +43,11 @@ bool CommandQueue::frontEndTrackingEnabled() const {
}
void CommandQueue::saveTagAndTaskCountForCommandLists(uint32_t numCommandLists, ze_command_list_handle_t *commandListHandles,
uint64_t tagGpuAddress, TaskCountType submittedTaskCount) {
NEO::GraphicsAllocation *tagGpuAllocation, TaskCountType submittedTaskCount) {
if (this->saveWaitForPreamble) {
for (uint32_t i = 0; i < numCommandLists; i++) {
auto commandList = CommandList::fromHandle(commandListHandles[i]);
commandList->saveLatestTagAndTaskCount(tagGpuAddress, submittedTaskCount);
commandList->saveLatestTagAndTaskCount(tagGpuAllocation, submittedTaskCount);
}
}
}
@@ -410,8 +410,9 @@ void CommandQueueImp::makeResidentForResidencyContainer(const NEO::ResidencyCont
}
}
bool CommandQueueImp::checkNeededPatchPreambleWait(uint64_t tagGpuAddress) {
return this->saveWaitForPreamble && (getCsr()->getTagAllocation()->getGpuAddress() != tagGpuAddress);
bool CommandQueueImp::checkNeededPatchPreambleWait(CommandList *commandList) {
uint64_t tagGpuAddress = commandList->getLatestTagGpuAddress();
return this->saveWaitForPreamble && (tagGpuAddress != 0) && (getCsr()->getTagAllocation()->getGpuAddress() != tagGpuAddress);
}
} // namespace L0