mirror of
https://github.com/opencv/opencv.git
synced 2026-11-30 13:22:08 -06:00
The new graph engine has no FP16 execution path yet and runs FP32 on CPU regardless of the requested target. When an OpenCL FP16 target is requested, callers may pass CV_16F input types to Net::getFLOPS(), which then flow through tryInferShapes() -> Layer::getTypes() and get rejected (CV_16F is only allowed when preferableTarget == DNN_TARGET_OPENCL_FP16, which the new engine never sets). Normalize FP16 input types to FP32 in the mainGraph path of getFLOPS via a small filterFP16InputTypes() helper. This fixes the OCL_FP16 parameterization of the DNNTestNetwork perf tests (e.g. YuNet_320/640/1280) which crashed in getFLOPS. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>