iree/hal/local/task_queue.c
// Cleanup for iree_hal_task_queue_retire_cmd_t that ensures that the arena
// holding the submission is properly disposed and that semaphores are signaled
// (or signaled to failure if the command failed).
Cleanup for iree_hal_task_queue_retire_cmd_t that ensures that the arena
holding the submission is properly disposed and that semaphores are signaled
(or signaled to failure if the command failed).
Cleanup for iree_hal_task_queue_retire_cmd_t that ensures that the arena holding the submission is properly disposed and that semaphores are signaled ( or signaled to failure if the command failed ) .
static void iree_hal_task_queue_retire_cmd_cleanup(iree_task_t* task,
                                                   iree_status_t status) {
  iree_hal_task_queue_retire_cmd_t* cmd =
      (iree_hal_task_queue_retire_cmd_t*)task;
  if (!iree_status_is_ok(status)) {
    for (iree_host_size_t i = 0; i < cmd->signal_semaphores.count; ++i) {
      iree_hal_semaphore_fail(cmd->signal_semaphores.semaphores[i],
                              iree_status_clone(status));
    }
  }
  iree_hal_semaphore_list_release(&cmd->signal_semaphores);
  iree_arena_allocator_t arena = cmd->arena;
  cmd = NULL;
  iree_arena_deinitialize(&arena);
}
static void iree_hal_task_queue_retire_cmd_cleanup ( iree_task_t * task , iree_status_t status ) { iree_hal_task_queue_retire_cmd_t * cmd = ( iree_hal_task_queue_retire_cmd_t * ) task ; if ( ! iree_status_is_ok ( status ) ) { for ( iree_host_size_t i = 0 ; i < cmd -> signal_semaphores . count ; ++ i ) { iree_hal_semaphore_fail ( cmd -> signal_semaphores . semaphores [ i ] , iree_status_clone ( status ) ) ; } } iree_hal_semaphore_list_release ( & cmd -> signal_semaphores ) ; iree_arena_allocator_t arena = cmd -> arena ; cmd = NULL ; iree_arena_deinitialize ( & arena ) ; }
Cleanup for iree_hal_task_queue_retire_cmd_t that ensures that the arena
holding the submission is properly disposed and that semaphores are signaled
(or signaled to failure if the command failed).
Cleanup for iree_hal_task_queue_retire_cmd_t that ensures that the arena holding the submission is properly disposed and that semaphores are signaled ( or signaled to failure if the command failed ) .
// If the command failed then fail all semaphores to ensure future // submissions fail as well (including those on other queues). // Release all semaphores. // Drop all memory used by the submission (**including cmd**).