From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C8F2B15800A for ; Mon, 28 Aug 2023 06:44:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 047A82BC073; Mon, 28 Aug 2023 06:44:08 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D61502BC073 for ; Mon, 28 Aug 2023 06:44:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AC701335D8D for ; Mon, 28 Aug 2023 06:44:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 49AFFF6B for ; Mon, 28 Aug 2023 06:44:05 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1693205017.f86f0e650d2bc739837a28cd32bc4c255cca258a.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-libs/opencv/files/opencv-4.8.0-arm64-fp16.patch X-VCS-Directories: media-libs/opencv/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: f86f0e650d2bc739837a28cd32bc4c255cca258a X-VCS-Branch: master Date: Mon, 28 Aug 2023 06:44:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 25962c7c-e700-4543-bc46-97ce887d940b X-Archives-Hash: b9fc2f8cdbdd7ab1e5e2285284354762 commit: f86f0e650d2bc739837a28cd32bc4c255cca258a Author: Sam James gentoo org> AuthorDate: Mon Aug 28 06:43:37 2023 +0000 Commit: Sam James gentoo org> CommitDate: Mon Aug 28 06:43:37 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f86f0e65 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 gentoo.org> .../opencv/files/opencv-4.8.0-arm64-fp16.patch | 56 +++++++++++----------- 1 file 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 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 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 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 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 // 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 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 // 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 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 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 } -#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 // 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 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 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 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 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 { 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 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 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 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 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 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 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 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 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 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 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 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 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);