Skip to contentSkip to conversation

opencv: Fix morph.cl related compilation error

PATCH In review Djordje Senicic 2 participants 2 messages Sep 17, 2019 – Sep 18, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opencv: Fix morph.cl related compilation error

- C6x intrinsic _min2(), _max2() cannot be applied to data types such as uchar3

---
 .../0001-morph.cl-fix-compilation-error.patch | 35 +++++++++++++++++++
 .../recipes-support/opencv/opencv_3.1.bb      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta-arago-extras/recipes-support/opencv/opencv/0001-morph.cl-fix-compilation-error.patch
meta-arago-extras/recipes-support/opencv/opencv/0001-morph.cl-fix-compilation-error.patch new file +35 -0
new file mode 100644
index 00000000..5f279f31
@@ -0,0 +1,35 @@
+From c3befabd0420d6665cc61931af5aea00e82977e3 Mon Sep 17 00:00:00 2001
+From: Djordje Senicic <[email protected]>
+Date: Tue, 17 Sep 2019 19:16:00 -0400
+Subject: [PATCH] morph.cl: fix compilation error
+
+Upstream-Status: Inappropriate [other]
+
+- TI C6x intrinsic _min2(), _max2() cannot be applied to data types  such as uchar3.
+
+Signed-off-by: Djordje Senicic <[email protected]>
+---
+ modules/imgproc/src/opencl/morph.cl | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/imgproc/src/opencl/morph.cl b/modules/imgproc/src/opencl/morph.cl
+index 8e3ab2fa0..47243ca0c 100644
+--- a/modules/imgproc/src/opencl/morph.cl
++++ b/modules/imgproc/src/opencl/morph.cl
+@@ -90,11 +90,11 @@
+ #if defined INTEL_DEVICE && defined DEPTH_0
+ #define MORPH_OP(A, B) ((A) < (B) ? (A) : (B))
+ #else
+-#define MORPH_OP(A, B) _min2((A), (B))
++#define MORPH_OP(A, B) min((A), (B))
+ #endif
+ #endif
+ #ifdef OP_DILATE
+-#define MORPH_OP(A, B) _max2((A), (B))
++#define MORPH_OP(A, B) max((A), (B))
+ #endif
+ 
+ #define PROCESS(y, x) \
+-- 
+2.17.1
+
meta-arago-extras/recipes-support/opencv/opencv_3.1.bb +1 -0
index acc9d71e..c9670fc6 100644
@@ -22,6 +22,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
     file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
     file://fixgcc60.patch \
     file://fixpkgconfig.patch \
+    file://0001-morph.cl-fix-compilation-error.patch \
     file://0001-Fix-sign-macro-redefinition-compile-time-error.patch;patchdir=../contrib \
 "
 
Signature · 1 line
2.17.1
#1 lore raw

Denys,

Please backport to ti2019.03.

Thanks,

Jake

Quoted 62 lines · Djordje Senicic

- C6x intrinsic _min2(), _max2() cannot be applied to data types such as uchar3

---
  .../0001-morph.cl-fix-compilation-error.patch | 35 +++++++++++++++++++
  .../recipes-support/opencv/opencv_3.1.bb      |  1 +
  2 files changed, 36 insertions(+)

create mode 100644 meta-arago-extras/recipes-support/opencv/opencv/0001-morph.cl-fix-compilation-error.patch

meta-arago-extras/recipes-support/opencv/opencv/0001-morph.cl-fix-compilation-error.patch new file +35 -0
new file mode 100644
index 00000000..5f279f31
@@ -0,0 +1,35 @@
+From c3befabd0420d6665cc61931af5aea00e82977e3 Mon Sep 17 00:00:00 2001
+From: Djordje Senicic <[email protected]>
+Date: Tue, 17 Sep 2019 19:16:00 -0400
+Subject: [PATCH] morph.cl: fix compilation error
+
+Upstream-Status: Inappropriate [other]
+
+- TI C6x intrinsic _min2(), _max2() cannot be applied to data types  such as uchar3.
+
+Signed-off-by: Djordje Senicic <[email protected]>
+---
+ modules/imgproc/src/opencl/morph.cl | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/imgproc/src/opencl/morph.cl b/modules/imgproc/src/opencl/morph.cl
+index 8e3ab2fa0..47243ca0c 100644
+--- a/modules/imgproc/src/opencl/morph.cl
++++ b/modules/imgproc/src/opencl/morph.cl
+@@ -90,11 +90,11 @@
+ #if defined INTEL_DEVICE && defined DEPTH_0
+ #define MORPH_OP(A, B) ((A) < (B) ? (A) : (B))
+ #else
+-#define MORPH_OP(A, B) _min2((A), (B))
++#define MORPH_OP(A, B) min((A), (B))
+ #endif
+ #endif
+ #ifdef OP_DILATE
+-#define MORPH_OP(A, B) _max2((A), (B))
++#define MORPH_OP(A, B) max((A), (B))
+ #endif
+
+ #define PROCESS(y, x) \
+--
+2.17.1
+
meta-arago-extras/recipes-support/opencv/opencv_3.1.bb +1 -0
index acc9d71e..c9670fc6 100644
@@ -22,6 +22,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
      file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
      file://fixgcc60.patch \
      file://fixpkgconfig.patch \
+    file://0001-morph.cl-fix-compilation-error.patch \
      file://0001-Fix-sign-macro-redefinition-compile-time-error.patch;patchdir=../contrib \
  "