Skip to main content

Module policy

Module policy 

Source
Expand description

CPU-vs-GPU backend selection.

The decision compares estimated end-to-end times built from measured throughputs: a one-time GPU micro-benchmark (GpuCalibration, cached per context) and CPU throughputs supplied by the caller (CpuCosts, measured by the flashraw facade the same way). Hard rules come first: software adapters are never auto-selected, tiny frames stay on the CPU, and outputs that need no processing never go through the GPU.

Structs§

CpuCosts
CPU throughputs (pixels per ms with all threads) for the same operations.
Decision
Outcome of decide.
GpuCalibration
Measured GPU characteristics.
Workload
Description of one decode for the cost model.

Enums§

WorkOutput
What the caller wants produced.

Constants§

GPU_MARGIN
The GPU must win by this factor (estimates are noisy; CPU is the safer default).
MIN_GPU_SAMPLES
Frames below this size stay on the CPU (fixed GPU overheads dominate).

Functions§

decide
Estimate CPU and GPU times and choose.