summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-08-28 07:43:37 +0100
committerSam James <sam@gentoo.org>2023-08-28 07:43:37 +0100
commitf86f0e650d2bc739837a28cd32bc4c255cca258a (patch)
treef8e7986eb533cf9350f20e2f1679002755a87deb /media-libs/opencv
parentdev-util/valgrind: add note wrt Fedora cherry-picks (diff)
downloadgentoo-f86f0e650d2bc739837a28cd32bc4c255cca258a.tar.gz
gentoo-f86f0e650d2bc739837a28cd32bc4c255cca258a.tar.bz2
gentoo-f86f0e650d2bc739837a28cd32bc4c255cca258a.zip
media-libs/opencv: fix amd64 build (oops)
Bug: https://bugs.gentoo.org/913031 Closes: https://bugs.gentoo.org/913131 Fixes: 4e6bb1138e0e8009b6e66b479e417d4d7c066fda Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/opencv')
-rw-r--r--media-libs/opencv/files/opencv-4.8.0-arm64-fp16.patch56
1 files changed, 28 insertions, 28 deletions
diff --git a/media-libs/opencv/files/opencv-4.8.0-arm64-fp16.patch b/media-libs/opencv/files/opencv-4.8.0-arm64-fp16.patch
index 84e36f88e6f7..6bf04daf58ae 100644
--- a/media-libs/opencv/files/opencv-4.8.0-arm64-fp16.patch
+++ b/media-libs/opencv/files/opencv-4.8.0-arm64-fp16.patch
@@ -23,7 +23,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
conv->useFP16 = false;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
// TODO: add FP16 support for Winograd.
if (_useFP16 && (conv->conv_type == CONV_TYPE_GENERIC || conv->conv_type == CONV_TYPE_DEPTHWISE_REMAIN))
conv->useFP16 = true;
@@ -32,7 +32,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
int nweights = C * padded_ksize;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (conv->useFP16)
{
conv->weightsBuf_FP16.resize(nweights + VEC_ALIGN);
@@ -41,7 +41,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
const int CONV_WINO_NATOMS_F32 = CONV_WINO_AREA / CONV_WINO_ATOM_F32; // for AVX2, it is 8, otherwise, it's 16.
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
// FP 16
const int CONV_WINO_ATOM_F16 = CONV_WINO_ATOM_F32 * 2;
const int CONV_WINO_NATOMS_F16 = CONV_WINO_AREA / CONV_WINO_ATOM_F16;
@@ -50,7 +50,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
float* wptrWino = nullptr;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
float16_t* wptrWino_FP16 = nullptr;
if (conv->useFP16)
{
@@ -59,7 +59,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
// repack the data.
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (conv->useFP16)
{
float16_t* wptr = wptrWino_FP16 + (g*Kg_nblocks + ki) * Cg *CONV_WINO_KBLOCK*CONV_WINO_AREA +
@@ -68,7 +68,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
float* weightsBufPtr = nullptr;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
int numStripsMR_FP16 = (Kg + CONV_MR_FP16 - 1) / CONV_MR_FP16;
int Kg_aligned_FP16 = numStripsMR_FP16 * CONV_MR_FP16;
size_t nweights_FP16 = ngroups * Kg_aligned_FP16 * DkHkWkCg;
@@ -77,7 +77,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
// Pack the weight.
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (conv->useFP16)
{
parallel_for_(Range(0, ngroups * numStripsMR_FP16), [&](const Range& r0){
@@ -86,7 +86,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
float* inptrInC = (float* )inptrIn;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
float16_t* inpbufC_FP16 = (float16_t *)inpbufC;
if (esz == sizeof(float16_t))
{
@@ -95,7 +95,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
float* inptrInC = inptrIn;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
float16_t* inpbufC_FP16 = (float16_t *)inpbufC;
if (esz == sizeof(float16_t))
{
@@ -104,7 +104,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
}
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
// Fast convert float 32 to float16
static inline void _cvt32f16f( const float* src, float16_t* dst, int len)
{
@@ -113,7 +113,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
// Make special branch where memcpy() is called with a constant buffer size.
// Compilers will likely unroll this loop properly.
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
for (int c = 0; c < Cg; c++, inptr += inp_planesize, inpbuf += CONV_NR_esz)
@@ -122,7 +122,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
else
{
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
for (int c = 0; c < Cg; c++, inptr += inp_planesize, inpbuf += CONV_NR_esz)
@@ -131,7 +131,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
int w1 = std::min(Wk, (Wi - in_w + dilation_w-1)/dilation_w);
const float* inptrInC = inptrIn;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
float16_t* inpbufC = (float16_t *)inpbuf + s0;
@@ -140,7 +140,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
const float* inptrInC = inptrIn;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
float16_t* inpbufC = (float16_t *)inpbuf + s0;
@@ -149,7 +149,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
int w1 = std::min(Wk, (Wi - in_w + dilation_w-1)/dilation_w);
const float* inptrInC = inptrIn;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
float16_t* inpbufC = (float16_t* )inpbuf + s0;
@@ -158,7 +158,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
{
float* inpbuf_ki = (float* )inpbuf + k * CONV_NR * Cg + i;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
float16_t * inpbuf_ki_FP16 = (float16_t *)inpbuf + k * CONV_NR * Cg + i;
#endif
@@ -167,7 +167,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
if (stride_w == 1)
{
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
for (int c = 0; c < Cg; c++, inpbuf_ki_FP16 += CONV_NR, inptr_ki += inp_planesize)
@@ -176,7 +176,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
else if (stride_w == 2)
{
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
for (int c = 0; c < Cg; c++, inpbuf_ki_FP16 += CONV_NR, inptr_ki += inp_planesize)
@@ -185,7 +185,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
else
{
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
for (int c = 0; c < Cg; c++, inpbuf_ki_FP16 += CONV_NR, inptr_ki += inp_planesize)
@@ -194,7 +194,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
if (stride_w == 1)
{
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
for (int c = 0; c < Cg; c++, inpbuf_ki_FP16 += CONV_NR, inptr_ki += inp_planesize)
@@ -203,7 +203,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
else
{
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
for (int c = 0; c < Cg; c++, inpbuf_ki_FP16 += CONV_NR, inptr_ki += inp_planesize)
@@ -212,7 +212,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
else
{
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
for (int c = 0; c < Cg; c++, inpbuf_ki_FP16 += CONV_NR, inptr_ki += inp_planesize)
@@ -221,7 +221,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
else
{
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
for (int c = 0; c < Cg; c++, inpbuf_ki_FP16 += CONV_NR)
@@ -230,7 +230,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
int esz = sizeof(float );
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
// works at FP 16.
@@ -239,7 +239,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
char *weights = nullptr;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
CV_Assert(!conv->weightsBuf_FP16.empty());
@@ -248,7 +248,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
if (conv->useNEON)
{
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
opt_NEON::convBlockMR1_FP16(DkHkWkCg, weights, inptr, cptr, biasVal, fusedAdd, minval, maxval, ifMinMaxAct, outLen, CONV_NR);
@@ -257,7 +257,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
if (conv->useNEON)
{
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
opt_NEON::convBlock_FP16(c1 - c0, wptr, inptr, (char *)cptr_f16, ldc, c0 == 0, outLen, CONV_MR, CONV_NR);
@@ -266,7 +266,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
int j = 0;
-#ifdef CONV_ARM_FP16
-+#if CV_FP16
++#if defined(CONV_ARM_FP16) && CV_FP16
if (useFP16)
{
float32x4_t vbias = vdupq_n_f32(biasval);