System information (version)
- OpenCV => current 3.4/master branch
- Operating System / Platform => Armv7 platform (Raspberry-pi, Tinker Board etc.)
- Compiler => GCC 6.3.0
Detailed description
When passing -DCPU_BASELINE=FP16 on Armv7 platform, it results in FAILURE
-- Performing Test HAVE_CXX_MFPU_NEON_FP16 (check file: cmake/checks/cpu_fp16.cpp)
-- Performing Test HAVE_CXX_MFPU_NEON_FP16 - Failed
-- FP16 is not supported by C++ compiler
-- Optimization FP16 is not available, skipped
(snip)
-- CPU/HW features:
-- Baseline: NEON
-- requested: FP16
-- required: NEON
-- disabled: VFPV3
GCC 6.3.0 requires -mfp16-format option to use float16 SIMD types.
#if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
typedef __fp16 float16_t;
typedef __simd64_float16_t float16x4_t;
#endif
The current implementation on OpenCV matches for GCC 4.x and 5.x series, but not for GCC 6 series.
To make things compatible for various GCC, we should pass both -mfpu=neon-fp16 and -mfp16-format=ieee to cpu_fp16.cpp during cmake
Steps to reproduce
cmake -DCPU_BASELINE=FP16 ..
on Armv7 platform and GCC 6 or later.
I'll send a patch later
System information (version)
Detailed description
When passing
-DCPU_BASELINE=FP16on Armv7 platform, it results in FAILUREGCC 6.3.0 requires
-mfp16-formatoption to use float16 SIMD types.The current implementation on OpenCV matches for GCC 4.x and 5.x series, but not for GCC 6 series.
To make things compatible for various GCC, we should pass both
-mfpu=neon-fp16and-mfp16-format=ieeetocpu_fp16.cppduring cmakeSteps to reproduce
on Armv7 platform and GCC 6 or later.
I'll send a patch later