Skip to main content

get_optimal_backend

Function get_optimal_backend 

Source
pub fn get_optimal_backend() -> GpuBackend
Expand description

First backend from SUPPORTED_BACKENDS-style probing that opens a context.

Backends are tried in the order WebGPU → Metal → OpenCL, then CPU as the always-available fallback. CUDA and ROCm are not probed: scirs2-core 0.6.x has no working context for either, so probing them would only cost a failed nvidia-smi/rocm-smi invocation per call.