Skip to main content

run_persistent_kernel

Function run_persistent_kernel 

Source
pub fn run_persistent_kernel(
    backend: &WgpuBackend,
    program: &Program,
    config: &DispatchConfig,
    queue: PersistentQueue,
) -> Result<PersistentKernelReport, BackendError>
Expand description

Compile a persistent pipeline and drain queue through the GPU.

The pipeline and bind-group layout are created once and reused for every work item. Only the input/output buffer contents change between launches. If the backend reports device loss before or during drainage, recovery is attempted and the pipeline is recompiled automatically.

ยงErrors

Returns BackendError when queue validation, pipeline compilation, device recovery, or GPU dispatch fails.