SWDEV-502365 - Track last used command

- This change tries to save extra synchronization packets we may insert
  as we didnt track the completion signals for every command. We track
the current enqueued command until it exits the enqueue stage. We also
record the exit scope to know if we flushed the caches
- Handle correct release scopes and store completion signal as HW events
- Use a new finishCommand implementation to only wait for the command
  passed as the argument

Change-Id: Ie4350c5dd24f5d48dfa6ccbabd892f0544caadcc
Этот коммит содержится в:
Saleel Kudchadker committed 2025-03-04 16:05:02 -05:00
1 родитель cece301fd4
Коммит e03e4f3b5d
12 files changed
+148 -92

No files matched your search

+18
Просмотреть файл
@@ -133,6 +133,24 @@ bool HostQueue::terminate() {
return true;
}
void HostQueue::finishCommand(Command* command) {
if (command == nullptr) {
command = getLastQueuedCommand(true);
if (command != nullptr) {
ClPrint(LOG_DEBUG, LOG_CMD, "No command, awaiting complete status on host");
command->awaitCompletion();
command->release();
}
return;
}
// Check hardware event status for the specific command
static constexpr bool kWaitCompletion = true;
if (!device().IsHwEventReady(command->event(), kWaitCompletion)) {
ClPrint(LOG_DEBUG, LOG_CMD, "No HW event, awaiting complete status on host");
command->awaitCompletion();
}
}
void HostQueue::finish(bool cpu_wait) {
Command* command = nullptr;
if (IS_HIP) {