Skip to main content

gpu_available

Function gpu_available 

Source
pub fn gpu_available() -> bool
Expand description

Prefer GPU when a shared device exists and policy allows it.

Without gpu-runtime this is the CPU floor: crate::gpu_context::try_shared_gpu returns None. On wasm32 the shared WebGPU device is installed by crate::gpu_context::ensure_shared_gpu(); until that completes this is also the CPU floor. Never panics.