Skip to main content

Lib

Struct Lib 

Source
pub struct Lib {
Show 24 fields pub ze_init: unsafe extern "C" fn(u32) -> ZeResult, pub driver_get: unsafe extern "C" fn(*mut u32, *mut DriverHandle) -> ZeResult, pub device_get: unsafe extern "C" fn(DriverHandle, *mut u32, *mut DeviceHandle) -> ZeResult, pub device_get_properties: unsafe extern "C" fn(DeviceHandle, *mut DeviceProperties) -> ZeResult, pub context_create: unsafe extern "C" fn(DriverHandle, *const ContextDesc, *mut ContextHandle) -> ZeResult, pub context_destroy: unsafe extern "C" fn(ContextHandle) -> ZeResult, pub command_queue_create: unsafe extern "C" fn(ContextHandle, DeviceHandle, *const CommandQueueDesc, *mut CommandQueueHandle) -> ZeResult, pub command_queue_destroy: unsafe extern "C" fn(CommandQueueHandle) -> ZeResult, pub command_queue_execute: unsafe extern "C" fn(CommandQueueHandle, u32, *const CommandListHandle, FenceHandle) -> ZeResult, pub command_queue_synchronize: unsafe extern "C" fn(CommandQueueHandle, u64) -> ZeResult, pub command_list_create: unsafe extern "C" fn(ContextHandle, DeviceHandle, *const CommandListDesc, *mut CommandListHandle) -> ZeResult, pub command_list_destroy: unsafe extern "C" fn(CommandListHandle) -> ZeResult, pub command_list_close: unsafe extern "C" fn(CommandListHandle) -> ZeResult, pub command_list_reset: unsafe extern "C" fn(CommandListHandle) -> ZeResult, pub command_list_append_launch_kernel: unsafe extern "C" fn(CommandListHandle, KernelHandle, *const GroupCount, EventHandle, u32, *mut EventHandle) -> ZeResult, pub command_list_append_barrier: unsafe extern "C" fn(CommandListHandle, EventHandle, u32, *mut EventHandle) -> ZeResult, pub mem_alloc_shared: unsafe extern "C" fn(ContextHandle, *const DeviceMemAllocDesc, *const HostMemAllocDesc, usize, usize, DeviceHandle, *mut *mut c_void) -> ZeResult, pub mem_free: unsafe extern "C" fn(ContextHandle, *mut c_void) -> ZeResult, pub module_create: unsafe extern "C" fn(ContextHandle, DeviceHandle, *const ModuleDesc, *mut ModuleHandle, *mut ModuleBuildLogHandle) -> ZeResult, pub module_destroy: unsafe extern "C" fn(ModuleHandle) -> ZeResult, pub kernel_create: unsafe extern "C" fn(ModuleHandle, *const KernelDesc, *mut KernelHandle) -> ZeResult, pub kernel_destroy: unsafe extern "C" fn(KernelHandle) -> ZeResult, pub kernel_set_group_size: unsafe extern "C" fn(KernelHandle, u32, u32, u32) -> ZeResult, pub kernel_set_argument_value: unsafe extern "C" fn(KernelHandle, u32, usize, *const c_void) -> ZeResult, /* private fields */
}
Expand description

Resolved Level Zero entry points. Keeps the loaded Library alive so the copied function pointers stay valid for the process lifetime.

Fields§

§ze_init: unsafe extern "C" fn(u32) -> ZeResult§driver_get: unsafe extern "C" fn(*mut u32, *mut DriverHandle) -> ZeResult§device_get: unsafe extern "C" fn(DriverHandle, *mut u32, *mut DeviceHandle) -> ZeResult§device_get_properties: unsafe extern "C" fn(DeviceHandle, *mut DeviceProperties) -> ZeResult§context_create: unsafe extern "C" fn(DriverHandle, *const ContextDesc, *mut ContextHandle) -> ZeResult§context_destroy: unsafe extern "C" fn(ContextHandle) -> ZeResult§command_queue_create: unsafe extern "C" fn(ContextHandle, DeviceHandle, *const CommandQueueDesc, *mut CommandQueueHandle) -> ZeResult§command_queue_destroy: unsafe extern "C" fn(CommandQueueHandle) -> ZeResult§command_queue_execute: unsafe extern "C" fn(CommandQueueHandle, u32, *const CommandListHandle, FenceHandle) -> ZeResult§command_queue_synchronize: unsafe extern "C" fn(CommandQueueHandle, u64) -> ZeResult§command_list_create: unsafe extern "C" fn(ContextHandle, DeviceHandle, *const CommandListDesc, *mut CommandListHandle) -> ZeResult§command_list_destroy: unsafe extern "C" fn(CommandListHandle) -> ZeResult§command_list_close: unsafe extern "C" fn(CommandListHandle) -> ZeResult§command_list_reset: unsafe extern "C" fn(CommandListHandle) -> ZeResult§command_list_append_launch_kernel: unsafe extern "C" fn(CommandListHandle, KernelHandle, *const GroupCount, EventHandle, u32, *mut EventHandle) -> ZeResult§command_list_append_barrier: unsafe extern "C" fn(CommandListHandle, EventHandle, u32, *mut EventHandle) -> ZeResult§mem_alloc_shared: unsafe extern "C" fn(ContextHandle, *const DeviceMemAllocDesc, *const HostMemAllocDesc, usize, usize, DeviceHandle, *mut *mut c_void) -> ZeResult§mem_free: unsafe extern "C" fn(ContextHandle, *mut c_void) -> ZeResult§module_create: unsafe extern "C" fn(ContextHandle, DeviceHandle, *const ModuleDesc, *mut ModuleHandle, *mut ModuleBuildLogHandle) -> ZeResult§module_destroy: unsafe extern "C" fn(ModuleHandle) -> ZeResult§kernel_create: unsafe extern "C" fn(ModuleHandle, *const KernelDesc, *mut KernelHandle) -> ZeResult§kernel_destroy: unsafe extern "C" fn(KernelHandle) -> ZeResult§kernel_set_group_size: unsafe extern "C" fn(KernelHandle, u32, u32, u32) -> ZeResult§kernel_set_argument_value: unsafe extern "C" fn(KernelHandle, u32, usize, *const c_void) -> ZeResult

Implementations§

Source§

impl Lib

Source

pub unsafe fn load() -> Result<Lib, String>

Open libze_loader and resolve every entry point. Err on any host without the oneAPI runtime (no library or a missing symbol).

Auto Trait Implementations§

§

impl Freeze for Lib

§

impl RefUnwindSafe for Lib

§

impl Send for Lib

§

impl Sync for Lib

§

impl Unpin for Lib

§

impl UnsafeUnpin for Lib

§

impl UnwindSafe for Lib

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.