SWDEV-423317 - Enable GPU wait for hip sync calls

hipStreamSynchronize and hipDeviceSynchronize won't longer wait
for CPU commands in DD mode

Change-Id: I079c8bbfc34ddc6d3e2d74c92a34665877e512a5


[ROCm/clr commit: fbea58ba11]
Este commit está contenido en:
German Andryeyev
2023-09-21 15:47:56 -04:00
padre f62807d411
commit 2d492a201b
Se han modificado 5 ficheros con 13 adiciones y 10 borrados
+4 -3
Ver fichero
@@ -113,7 +113,7 @@ bool HostQueue::terminate() {
return true;
}
void HostQueue::finish() {
void HostQueue::finish(bool cpu_wait) {
Command* command = nullptr;
if (IS_HIP) {
command = getLastQueuedCommand(true);
@@ -121,7 +121,8 @@ void HostQueue::finish() {
return;
}
}
if (nullptr == command || vdev()->isHandlerPending() || vdev()->isFenceDirty()) {
if (nullptr == command || command->type() != CL_COMMAND_MARKER ||
vdev()->isHandlerPending() || vdev()->isFenceDirty()) {
if (nullptr != command) {
command->release();
}
@@ -135,7 +136,7 @@ void HostQueue::finish() {
}
// Check HW status of the ROCcrl event. Note: not all ROCclr modes support HW status
static constexpr bool kWaitCompletion = true;
if (!device().IsHwEventReady(command->event(), kWaitCompletion)) {
if (cpu_wait || !device().IsHwEventReady(command->event(), kWaitCompletion)) {
ClPrint(LOG_DEBUG, LOG_CMD, "HW Event not ready, awaiting completion instead");
command->awaitCompletion();
}