diff options
Diffstat (limited to 'zluda/src/impl/mod.rs')
-rw-r--r-- | zluda/src/impl/mod.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/zluda/src/impl/mod.rs b/zluda/src/impl/mod.rs index f12e964..fc8fbee 100644 --- a/zluda/src/impl/mod.rs +++ b/zluda/src/impl/mod.rs @@ -275,23 +275,25 @@ impl GlobalState { fn lock_enqueue( stream: *mut stream::Stream, - f: impl FnOnce(&l0::CommandList, &l0::Event<'static>, &[&l0::Event<'static>]) -> Result<(), CUresult>, + f: impl FnOnce( + &l0::CommandList, + &l0::Event<'static>, + &[&l0::Event<'static>], + ) -> Result<(), CUresult>, ) -> Result<(), CUresult> { Self::lock_stream(stream, |stream_data| { let l0_dev = unsafe { (*(*stream_data.context).device).base }; let l0_ctx = unsafe { &mut (*(*stream_data.context).device).l0_context }; let event_pool = unsafe { &mut (*(*stream_data.context).device).event_pool }; - let cmd_list = unsafe { mem::transmute(stream_data.command_list()?) }; + let cmd_list = unsafe { transmute_lifetime(&stream_data.cmd_list) }; stream_data - .process_finished_events(&mut |(_, marker)| event_pool.mark_as_free(marker))?; + .drop_finished_events(&mut |(_, marker)| event_pool.mark_as_free(marker))?; let prev_event = stream_data.get_last_event(); let prev_event_array = prev_event.map(|e| [e]); let empty = []; let prev_event_slice = prev_event_array.as_ref().map_or(&empty[..], |arr| &arr[..]); let (new_event, new_marker) = event_pool.get(l0_dev, l0_ctx)?; - f(&cmd_list, &new_event, prev_event_slice)?; - cmd_list.close()?; - unsafe { stream_data.queue.execute(&cmd_list, None)? }; + f(cmd_list, &new_event, prev_event_slice)?; stream_data.push_event((new_event, new_marker)); Ok(()) })? |