Skip to contentSkip to conversation

Revert "opencv: disable broken Intel FP16 detection"

PATCH New Randy MacLeod 1 participant 2 messages May 2, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Revert "opencv: disable broken Intel FP16 detection"

This reverts commit 51fbd3cf7db14399bc1c69c4a5fd63f157fd209d.

The long log was truncated due to a formatting error.

---
 .../0001-Revert-cuda-fix-fp16-compilation.patch    |  27 ---
 ...vert-check-FP16-build-condition-correctly.patch | 245 ---------------------
 meta-oe/recipes-support/opencv/opencv_3.2.bb       |   2 -
 3 files changed, 274 deletions(-)
 delete mode 100644 meta-oe/recipes-support/opencv/opencv/0001-Revert-cuda-fix-fp16-compilation.patch
 delete mode 100644 meta-oe/recipes-support/opencv/opencv/0002-Revert-check-FP16-build-condition-correctly.patch
meta-oe/recipes-support/opencv/opencv/0001-Revert-cuda-fix-fp16-compilation.patch deleted +0 -27
deleted file mode 100644
index 507d796..0000000
@@ -1,27 +0,0 @@
-From 69f9707678190f6a0948a547dce948251f972676 Mon Sep 17 00:00:00 2001
-From: Randy MacLeod <[email protected]>
-Date: Wed, 26 Apr 2017 14:57:30 -0400
-Subject: [PATCH 1/2] Revert "cuda: fix fp16 compilation"
-
-This reverts commit 12e00827be40576b686ea4438a6e6ef85208743d.
----
- modules/core/include/opencv2/core/cvdef.h | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h
-index 699b166..efc24ca 100644
---- a/modules/core/include/opencv2/core/cvdef.h
-+++ b/modules/core/include/opencv2/core/cvdef.h
-@@ -303,8 +303,7 @@ enum CpuFeatures {
- #define CV_2PI 6.283185307179586476925286766559
- #define CV_LOG2 0.69314718055994530941723212145818
- 
--#if defined __ARM_FP16_FORMAT_IEEE \
--    && !defined __CUDACC__
-+#if defined (__ARM_FP16_FORMAT_IEEE)
- #  define CV_FP16_TYPE 1
- #else
- #  define CV_FP16_TYPE 0
--- 
-2.9.3
-
meta-oe/recipes-support/opencv/opencv/0002-Revert-check-FP16-build-condition-correctly.patch deleted +0 -245

245 lines not on this page · raw message

meta-oe/recipes-support/opencv/opencv_3.2.bb +0 -2
index 98b6b06..2cff212 100644
@@ -27,8 +27,6 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
     file://fixpkgconfig.patch \
     file://uselocalxfeatures.patch;patchdir=../contrib/ \
     file://useoeprotobuf.patch;patchdir=../contrib/ \
-    file://0001-Revert-cuda-fix-fp16-compilation.patch \
-    file://0002-Revert-check-FP16-build-condition-correctly.patch \
 "
 
 PV = "3.2+git${SRCPV}"
Signature · 1 line
2.9.3
#1 lore raw

PATCH 2/2 opencv: disable broken Intel FP16 detection

With opencv-3.2, the configuration detects if the target supports half-precision floating-point format. This fails to compile for some Intel targets such as skylake with an error such as:
error: '_mm_cvtph_ps' was not declared in this scope

The configuration used to work in opencv-3.1 so revert two commits to drop the FP16 detection even though it may make opencv slower. The only change in the configure log is:
- FP16: Compiler support is available
+ FP16: Compiler support is not available

The patch should be dropped when a newer version of opencv that includes commit:
https://github.com/opencv/opencv/commit/e5d9b608c47d54e43496041595025fa282fa9de5
is available. Backporting that fix was complicated.

---
 .../0001-Revert-cuda-fix-fp16-compilation.patch    |  27 +++
 ...vert-check-FP16-build-condition-correctly.patch | 245 +++++++++++++++++++++
 meta-oe/recipes-support/opencv/opencv_3.2.bb       |   2 +
 3 files changed, 274 insertions(+)
 create mode 100644 meta-oe/recipes-support/opencv/opencv/0001-Revert-cuda-fix-fp16-compilation.patch
 create mode 100644 meta-oe/recipes-support/opencv/opencv/0002-Revert-check-FP16-build-condition-correctly.patch
meta-oe/recipes-support/opencv/opencv/0001-Revert-cuda-fix-fp16-compilation.patch new file +27 -0
new file mode 100644
index 0000000..507d796
@@ -0,0 +1,27 @@
+From 69f9707678190f6a0948a547dce948251f972676 Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <[email protected]>
+Date: Wed, 26 Apr 2017 14:57:30 -0400
+Subject: [PATCH 1/2] Revert "cuda: fix fp16 compilation"
+
+This reverts commit 12e00827be40576b686ea4438a6e6ef85208743d.
+---
+ modules/core/include/opencv2/core/cvdef.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h
+index 699b166..efc24ca 100644
+--- a/modules/core/include/opencv2/core/cvdef.h
++++ b/modules/core/include/opencv2/core/cvdef.h
+@@ -303,8 +303,7 @@ enum CpuFeatures {
+ #define CV_2PI 6.283185307179586476925286766559
+ #define CV_LOG2 0.69314718055994530941723212145818
+ 
+-#if defined __ARM_FP16_FORMAT_IEEE \
+-    && !defined __CUDACC__
++#if defined (__ARM_FP16_FORMAT_IEEE)
+ #  define CV_FP16_TYPE 1
+ #else
+ #  define CV_FP16_TYPE 0
+-- 
+2.9.3
+
meta-oe/recipes-support/opencv/opencv/0002-Revert-check-FP16-build-condition-correctly.patch new file +245 -0

245 lines not on this page · raw message

meta-oe/recipes-support/opencv/opencv_3.2.bb +2 -0
index 2cff212..98b6b06 100644
@@ -27,6 +27,8 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
     file://fixpkgconfig.patch \
     file://uselocalxfeatures.patch;patchdir=../contrib/ \
     file://useoeprotobuf.patch;patchdir=../contrib/ \
+    file://0001-Revert-cuda-fix-fp16-compilation.patch \
+    file://0002-Revert-check-FP16-build-condition-correctly.patch \
 "
 
 PV = "3.2+git${SRCPV}"
Signature · 1 line
2.9.3