Implement stream-wide event reuse

This commit is contained in:
Andrzej Janik 2021-07-04 19:06:37 +02:00
commit 5b593ec185
3 changed files with 49 additions and 22 deletions

View file

@ -1123,7 +1123,7 @@ impl<'a> Event<'a> {
}
pub fn host_synchronize(&self, timeout_ns: u64) -> Result<()> {
check!{ sys::zeEventHostSynchronize(self.as_ffi(), timeout_ns) };
check! { sys::zeEventHostSynchronize(self.as_ffi(), timeout_ns) };
Ok(())
}
@ -1136,6 +1136,11 @@ impl<'a> Event<'a> {
}
}
pub fn host_reset(&self) -> Result<()> {
check! { sys::zeEventHostReset(self.as_ffi()) };
Ok(())
}
unsafe fn with_raw_slice<'x, T>(
events: &[&Event<'x>],
f: impl FnOnce(u32, *mut sys::ze_event_handle_t) -> T,