pub struct Context {
pub driver: ZeDriverHandle,
pub device: ZeDeviceHandle,
pub context: ZeContextHandle,
pub queue: ZeCommandQueueHandle,
pub list: ZeCommandListHandle,
pub queue_ordinal: u32,
/* private fields */
}Fields§
§driver: ZeDriverHandle§device: ZeDeviceHandle§context: ZeContextHandle§queue: ZeCommandQueueHandle§list: ZeCommandListHandle§queue_ordinal: u32Command-queue-group ordinal chosen for compute. Kept for later
zeCommandListAppendLaunchKernel dispatches.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new(global_ordinal: u32) -> Option<Self>
pub fn new(global_ordinal: u32) -> Option<Self>
Walk drivers + devices, pick the global_ordinal-th device in
the same order drv::enumerate produces, and bring up a
context + compute queue + list on it.
Source§impl Context
impl Context
Sourcepub fn alloc_device(
&self,
size: usize,
alignment: usize,
) -> Option<DeviceBuffer>
pub fn alloc_device( &self, size: usize, alignment: usize, ) -> Option<DeviceBuffer>
Allocate size bytes of device-local memory on this context’s
device. Returned pointer is an unmapped USM address valid for
zeCommandListAppendMemoryCopy and kernel arg binding.
Allocate size bytes of shared USM (host + device accessible).
Sourcepub fn load_spirv(&self, spirv: &[u8]) -> Option<Module>
pub fn load_spirv(&self, spirv: &[u8]) -> Option<Module>
Load a SPIR-V module onto the device.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Context
impl !Sync for Context
impl Freeze for Context
impl RefUnwindSafe for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more