@@ -229,6 +229,7 @@ std::vector<sycl::event> _populate_packed_shapes_strides_for_indexing(
229229 cgh.host_task ([packed_host_axes_shapes_strides_shp,
230230 packed_host_shapes_strides_shp]() {});
231231 });
232+ clean_up_host_task_ev.wait ();
232233 host_task_events.push_back (clean_up_host_task_ev);
233234
234235 std::vector<sycl::event> v = {device_orthog_shapes_strides_copy_ev,
@@ -282,6 +283,7 @@ std::vector<sycl::event> _populate_packed_shapes_strides_for_indexing(
282283 cgh.depends_on (device_axes_shapes_strides_copy_ev);
283284 cgh.host_task ([packed_host_axes_shapes_strides_shp]() {});
284285 });
286+ clean_up_host_task_ev.wait ();
285287 host_task_events.push_back (clean_up_host_task_ev);
286288
287289 std::vector<sycl::event> v = {device_orthog_shapes_strides_fill_ev,
@@ -627,6 +629,7 @@ usm_ndarray_take(dpctl::tensor::usm_ndarray src,
627629 cgh.host_task ([host_ind_offsets_shp, host_ind_shapes_strides_shp,
628630 host_ind_ptrs_shp]() {});
629631 });
632+ shared_ptr_cleanup_host_task.wait ();
630633 host_task_events.push_back (shared_ptr_cleanup_host_task);
631634
632635 std::vector<sycl::event> ind_pack_depends{packed_ind_ptrs_copy_ev,
@@ -1039,6 +1042,7 @@ usm_ndarray_put(dpctl::tensor::usm_ndarray dst,
10391042 cgh.host_task ([host_ind_offsets_shp, host_ind_shapes_strides_shp,
10401043 host_ind_ptrs_shp]() {});
10411044 });
1045+ shared_ptr_cleanup_host_task.wait ();
10421046 host_task_events.push_back (shared_ptr_cleanup_host_task);
10431047
10441048 std::vector<sycl::event> ind_pack_depends{packed_ind_ptrs_copy_ev,
0 commit comments