Skip to main content

Module forge_bicubic

Module forge_bicubic 

Source
Expand description

Bicubic (Keys a=-0.5) NCHW f32 resize via Forge WGSL on the auxiliary GPU circuit.

Matches the CPU Keys cubic used by cv::sr::bicubic_u8 (per-channel NCHW). Direct WGSL dispatch (not yet a graph OpNode) so product SR can use GPU without waiting on IR lowerer expansion.

Device routing: vision SR runs on the auxiliary circuit (the iGPU when present) to keep the discrete GPU free for the LLM. The device comes from crate::gpu_context::device_registry::try_auxiliary_gpu, whose fallback chain is auxiliary → primary → CPU: on a single-GPU box it transparently uses the primary device, and on a GPU-less box it returns None, so this function reports BackendUnavailable and the caller (super::dispatch) degrades to the CPU oracle. It never panics.

Constants§

BICUBIC_ENTRY

Functions§

bicubic2d_cpu
CPU bicubic NCHW oracle (same Keys weights as WGSL).
bicubic2d_wgsl
WGSL bicubic upsample. params u32: [c, h_in, w_in, h_out, w_out, 0, 0, 0].
try_resize_bicubic_shared_gpu
Attempt bicubic NCHW resize on the auxiliary GPU circuit (iGPU when present; falls back auxiliary → primary → CPU). Returns Err(BackendUnavailable) on a GPU-less box so the caller degrades to the CPU oracle. Never panics.