Skip to main content

Module level_zero

Module level_zero 

Source
Expand description

Hand-rolled Level Zero (ze_*) FFI, dynamically loaded with libloading.

Only the subset RLX needs is bound: init + driver/device enumeration and properties (for availability + device name), context/queue/command-list lifecycle, USM-shared allocation, and SPIR-V module → kernel → launch. The loader (libze_loader) is opened at runtime, so the crate links and builds on hosts with no oneAPI runtime (macOS, CI) — Lib::load simply returns Err there and the whole backend reports itself unavailable.

⚠️ The ZE_STRUCTURE_TYPE_* enum values and descriptor field layouts are transcribed from ze_api.h (Level Zero spec v1.x). They are exercised only on real Intel hardware (Arc / Data Center Max) during bring-up; verify them against the installed loader version there. Nothing in this module runs on the macOS dev box — the backend falls through to the CPU reference path.

Structs§

CommandListDesc
CommandQueueDesc
ContextDesc
DeviceMemAllocDesc
DeviceProperties
DeviceUuid
GroupCount
HostMemAllocDesc
KernelDesc
Lib
Resolved Level Zero entry points. Keeps the loaded Library alive so the copied function pointers stay valid for the process lifetime.
ModuleDesc

Constants§

ZE_COMMAND_QUEUE_MODE_DEFAULT
ze_command_queue_mode_t: DEFAULT = 0.
ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS
ze_command_queue_mode_t: SYNCHRONOUS = 1 (execute blocks until complete).
ZE_DEVICE_TYPE_GPU
ze_device_type_t: GPU = 1.
ZE_MAX_DEVICE_NAME
ZE_MAX_DEVICE_UUID_SIZE
ZE_MODULE_FORMAT_IL_SPIRV
ze_module_format_t: IL_SPIRV = 0.
ZE_RESULT_SUCCESS
ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC
ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC
ZE_STRUCTURE_TYPE_CONTEXT_DESC
ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC
ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES
ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC
ZE_STRUCTURE_TYPE_KERNEL_DESC
ZE_STRUCTURE_TYPE_MODULE_DESC

Functions§

check
Map a non-success ZeResult to a printable error.

Type Aliases§

CommandListHandle
CommandQueueHandle
ContextHandle
DeviceHandle
DriverHandle
EventHandle
FenceHandle
KernelHandle
ModuleBuildLogHandle
ModuleHandle
ZeResult