pub struct OneApiDevice {
pub lib: Lib,
pub driver: DriverHandle,
pub device: DeviceHandle,
pub context: ContextHandle,
pub queue: CommandQueueHandle,
pub queue_ordinal: u32,
pub name: String,
/* private fields */
}Expand description
Owned Level Zero context. One per process.
Fields§
§lib: Lib§driver: DriverHandle§device: DeviceHandle§context: ContextHandle§queue: CommandQueueHandle§queue_ordinal: u32Command-queue-group ordinal the compute queue/list were created on.
name: StringImplementations§
Source§impl OneApiDevice
impl OneApiDevice
Allocate a host-accessible USM-shared buffer of size bytes, zeroed.
Returns the device pointer (also CPU-dereferenceable on integrated /
shared-memory Intel GPUs).
Sourcepub fn free(&self, ptr: *mut c_void)
pub fn free(&self, ptr: *mut c_void)
Free a USM buffer previously returned by alloc_shared.
Sourcepub fn create_command_list(&self) -> Result<CommandListHandle, String>
pub fn create_command_list(&self) -> Result<CommandListHandle, String>
Create a fresh closed-on-demand command list on the compute group.
Sourcepub fn execute_sync(&self, list: CommandListHandle) -> Result<(), String>
pub fn execute_sync(&self, list: CommandListHandle) -> Result<(), String>
Close list, execute it on the compute queue, and block until complete.
Serialized across threads (queues need external synchronization).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for OneApiDevice
impl RefUnwindSafe for OneApiDevice
impl Unpin for OneApiDevice
impl UnsafeUnpin for OneApiDevice
impl UnwindSafe for OneApiDevice
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more