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§
- Work
Output - What the caller wants produced.
Constants§
- AHD_
CPU_ FACTOR - The same for the AHD demosaic: on the CPU 2.3x (x86-64, 45 MP Bayer, develop to RGBA8 on one thread), on the GPU 5.2x (Apple M1 Ultra, 24 MP Bayer, kernel time 26 ms against 5 ms).
- AHD_
GPU_ FACTOR - EDGE_
CPU_ FACTOR - Cost of the edge-aware demosaic relative to the bilinear one, for the develop step alone: on the CPU (measured 4.4x to 9.2x: Apple M1 Ultra, X-Trans and Bayer; 3.7x to 5.5x on x86-64) and on the GPU (measured 6.2x to 6.3x on an Apple M1 Ultra, kernel time). Rounded; only the CPU/GPU ratio matters.
- EDGE_
GPU_ FACTOR - 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.