diff options
author | Andrzej Janik <[email protected]> | 2021-07-04 15:40:08 +0200 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2021-07-04 15:40:08 +0200 |
commit | ecc33f7b105373264807d09f6bdcadb93e59f1f0 (patch) | |
tree | bf7e0fc6f443062ca7bb61507d0db815614267ae /level_zero | |
parent | d76ffd691cdb495c24c81fda82bd2b3c99d51531 (diff) | |
download | ZLUDA-ecc33f7b105373264807d09f6bdcadb93e59f1f0.tar.gz ZLUDA-ecc33f7b105373264807d09f6bdcadb93e59f1f0.zip |
Make everything async
Diffstat (limited to 'level_zero')
-rw-r--r-- | level_zero/src/ze.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/level_zero/src/ze.rs b/level_zero/src/ze.rs index 16a98a0..30146a2 100644 --- a/level_zero/src/ze.rs +++ b/level_zero/src/ze.rs @@ -781,6 +781,26 @@ impl<'a> CommandList<'a> { Ok(unsafe { Self::from_ffi(result) })
}
+ pub fn new_immediate(ctx: &'a Context, dev: Device) -> Result<Self> {
+ let queue_desc = sys::ze_command_queue_desc_t {
+ stype: sys::ze_structure_type_t::ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC,
+ pNext: ptr::null(),
+ ordinal: 0,
+ index: 0,
+ flags: sys::ze_command_queue_flags_t(0),
+ mode: sys::ze_command_queue_mode_t::ZE_COMMAND_QUEUE_MODE_DEFAULT,
+ priority: sys::ze_command_queue_priority_t::ZE_COMMAND_QUEUE_PRIORITY_NORMAL,
+ };
+ let mut result: sys::ze_command_list_handle_t = ptr::null_mut();
+ check!(sys::zeCommandListCreateImmediate(
+ ctx.as_ffi(),
+ dev.as_ffi(),
+ &queue_desc,
+ &mut result
+ ));
+ Ok(unsafe { Self::from_ffi(result) })
+ }
+
pub unsafe fn append_memory_copy<
'dep,
T: 'a + 'dep + Copy + Sized,
|