[hip][cuda] Fix tracing in deferred streams after a bad merge. (#17909)
This was causing the stream_command_buffer to be deleted right away
which broke assumptions in an update for tracing.
Signed-off-by: Andrew Woloszyn <andrew.woloszyn@gmail.com>
diff --git a/runtime/src/iree/hal/drivers/cuda/pending_queue_actions.c b/runtime/src/iree/hal/drivers/cuda/pending_queue_actions.c
index 3456081..b49c116 100644
--- a/runtime/src/iree/hal/drivers/cuda/pending_queue_actions.c
+++ b/runtime/src/iree/hal/drivers/cuda/pending_queue_actions.c
@@ -757,6 +757,9 @@
action->device, mode, IREE_HAL_COMMAND_CATEGORY_ANY,
/*binding_capacity=*/0, &stream_command_buffer));
IREE_RETURN_AND_END_ZONE_IF_ERROR(
+ z0, iree_hal_resource_set_insert(action->resource_set, 1,
+ &stream_command_buffer));
+ IREE_RETURN_AND_END_ZONE_IF_ERROR(
z0, iree_hal_deferred_command_buffer_apply(
command_buffer, stream_command_buffer, binding_table));
iree_hal_cuda_stream_notify_submitted_commands(stream_command_buffer);
diff --git a/runtime/src/iree/hal/drivers/hip/pending_queue_actions.c b/runtime/src/iree/hal/drivers/hip/pending_queue_actions.c
index fb02bc1..d63ac2a 100644
--- a/runtime/src/iree/hal/drivers/hip/pending_queue_actions.c
+++ b/runtime/src/iree/hal/drivers/hip/pending_queue_actions.c
@@ -760,6 +760,9 @@
action->device, mode, IREE_HAL_COMMAND_CATEGORY_ANY,
/*binding_capacity=*/0, &stream_command_buffer));
IREE_RETURN_AND_END_ZONE_IF_ERROR(
+ z0, iree_hal_resource_set_insert(action->resource_set, 1,
+ &stream_command_buffer));
+ IREE_RETURN_AND_END_ZONE_IF_ERROR(
z0, iree_hal_deferred_command_buffer_apply(
command_buffer, stream_command_buffer, binding_table));
iree_hal_hip_stream_notify_submitted_commands(stream_command_buffer);