Skip to content

Commit

Permalink
[hip] Try again to fix the semaphore busy loop. (#19712)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Woloszyn <andrew.woloszyn@gmail.com>
  • Loading branch information
AWoloszyn authored Jan 16, 2025
1 parent 6f33cd4 commit 08b44e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runtime/src/iree/hal/drivers/hip/event_semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ iree_status_t iree_hal_hip_semaphore_multi_wait(
// it is because the event has already been signaled to that value.
if (!cpu_events[i]) {
semaphore_hit = true;
if (iree_hal_hip_semaphore_is_aborted(semaphore_list.semaphores[i])) {
status = iree_make_status(IREE_STATUS_ABORTED,
"the semaphore was aborted");
}
break;
}
}
Expand Down Expand Up @@ -842,10 +846,6 @@ static iree_status_t iree_hal_hip_semaphore_wait(
iree_notification_prepare_wait(&semaphore->state_notification);
iree_slim_mutex_unlock(&semaphore->mutex);

// We are going to pick up the correct status from query_locked below.
iree_status_ignore(
iree_hal_hip_event_semaphore_run_scheduled_callbacks(base_semaphore));

// We have to wait for the semaphore to catch up.
bool committed =
iree_notification_commit_wait(&semaphore->state_notification, wait,
Expand Down

0 comments on commit 08b44e2

Please sign in to comment.