From patchwork Fri Jan 17 00:25:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 55693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54192C0218D for ; Fri, 17 Jan 2025 00:25:25 +0000 (UTC) Received: from lelvem-ot01.ext.ti.com (lelvem-ot01.ext.ti.com [198.47.23.234]) by mx.groups.io with SMTP id smtpd.web11.601.1737073523736819485 for ; Thu, 16 Jan 2025 16:25:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kQH8TptS; spf=pass (domain: ti.com, ip: 198.47.23.234, mailfrom: afd@ti.com) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelvem-ot01.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 50H0PMXZ092000 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 18:25:22 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1737073522; bh=z+QOUHGpKSmjDgA19PJDuoCIeBuqJSN0ECbWcJ5vLko=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kQH8TptSHQiQjZ56x7CaVZFFSk93ksgl/eU5XpqME3H6dBbPl8OIIVZHLb3jVbGch bwVHtRn9lgA2kyNXTOHLB+uGlrP7gbDpOM8KarHOxM/31ugH4IbZUw1AgWDQ7OUUAd 9NXnND1Q/MGTDcUqm55wePl+y6X7PHEOuQhrS0rA= Received: from DLEE110.ent.ti.com (dlee110.ent.ti.com [157.170.170.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 50H0PMI4005059 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 16 Jan 2025 18:25:22 -0600 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 16 Jan 2025 18:25:22 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 16 Jan 2025 18:25:22 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 50H0PLnq007059; Thu, 16 Jan 2025 18:25:22 -0600 From: Andrew Davis To: Denys Dmytriyenko , Ryan Eatmon , Chirag Shilwant , CC: Andrew Davis Subject: [meta-arago][scarthgap/master][PATCH 1/6] flatbuffers: Remove this recipe Date: Thu, 16 Jan 2025 18:25:15 -0600 Message-ID: <20250117002520.627504-2-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250117002520.627504-1-afd@ti.com> References: <20250117002520.627504-1-afd@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Jan 2025 00:25:25 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/15699 This was used for TFlite and ARMNN before it was included in meta-oe. A newer better maintained version of this is in meta-oe now. Signed-off-by: Andrew Davis --- .../flatbuffers/flatbuffers_1.11.0.bb | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb diff --git a/meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb b/meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb deleted file mode 100644 index 7f7b8b99..00000000 --- a/meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb +++ /dev/null @@ -1,34 +0,0 @@ -SUMMARY = "Memory Efficient Serialization Library" -HOMEPAGE = "https://github.com/google/flatbuffers" -SECTION = "console/tools" -LICENSE = "Apache-2.0" - -PACKAGE_BEFORE_PN = "${PN}-compiler" - -RDEPENDS:${PN}-compiler = "${PN}" -RDEPENDS:${PN}-dev += "${PN}-compiler" - -LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a873c5645c184d51e0f9b34e1d7cf559" - -SRCREV = "bf9eb67ab9371755c6bcece13cadc7693bcbf264" - -SRC_URI = "git://github.com/google/flatbuffers.git;protocol=https;branch=master" - -# Make sure C++11 is used, required for example for GCC 4.9 -CXXFLAGS += "-std=c++11" -BUILD_CXXFLAGS += "-std=c++11" - -# BUILD_TYPE=Release is required, otherwise flatc is not installed -EXTRA_OECMAKE += "\ - -DCMAKE_BUILD_TYPE=Release \ - -DFLATBUFFERS_BUILD_TESTS=OFF \ - -DFLATBUFFERS_BUILD_SHAREDLIB=ON \ -" - -inherit cmake - -S = "${WORKDIR}/git" - -FILES:${PN}-compiler = "${bindir}" - -BBCLASSEXTEND = "native nativesdk" From patchwork Fri Jan 17 00:25:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 55695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39CBDC02188 for ; Fri, 17 Jan 2025 00:25:25 +0000 (UTC) Received: from lelvem-ot02.ext.ti.com (lelvem-ot02.ext.ti.com [198.47.23.235]) by mx.groups.io with SMTP id smtpd.web10.654.1737073524111424556 for ; Thu, 16 Jan 2025 16:25:24 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ti.com header.s=ti-com-17Q1 header.b=f0WlPJ+3; spf=pass (domain: ti.com, ip: 198.47.23.235, mailfrom: afd@ti.com) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelvem-ot02.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 50H0PNkg235675 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Jan 2025 18:25:23 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1737073523; bh=QhAfwF2+rmjXk6ydbXvg2Lg5p4MlVzsyxjeq636gpZg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=f0WlPJ+3WMRk5OUJYNpz4Yf6eFjSu3OWlzmMMCWjdSX/vYjF6mPpMmmvUQOVFCI1J wpug5dDk+sz6+J8q8B0gwQdUaQo6YpY5eaqybXaog1Oz8rMLB5m6uJLeIoSbYI9jl4 Wrvbma8UIFpEoe0RBrp5k5p3sXbDZaFWLSJX1/1I= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTP id 50H0PNgO094665; Thu, 16 Jan 2025 18:25:23 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 16 Jan 2025 18:25:22 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 16 Jan 2025 18:25:22 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 50H0PLnr007059; Thu, 16 Jan 2025 18:25:22 -0600 From: Andrew Davis To: Denys Dmytriyenko , Ryan Eatmon , Chirag Shilwant , CC: Andrew Davis Subject: [meta-arago][scarthgap/master][PATCH 2/6] meta-arago-extras: Add recipe for arm-compute-library Date: Thu, 16 Jan 2025 18:25:16 -0600 Message-ID: <20250117002520.627504-3-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250117002520.627504-1-afd@ti.com> References: <20250117002520.627504-1-afd@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-MIME-Autoconverted: from 8bit to quoted-printable by lelvem-ot02.ext.ti.com id 50H0PNkg235675 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Jan 2025 00:25:25 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/15700 The Compute Library is a collection of low-level machine learning functions optimized for Arm. This will be used for ARMNN and other machine learning applications and frameworks. Signed-off-by: Andrew Davis --- ...-indention-in-cmake-generator-script.patch | 130 ++++++++++++ ...ENABLE_NEON-in-code-for-checking-NEO.patch | 114 ++++++++++ ...ENABLE_SVE-in-code-for-checking-SVE-.patch | 197 ++++++++++++++++++ ...rce-files-at-library-definition-time.patch | 167 +++++++++++++++ ...ptions-for-SVE-SVE2-and-BF16-support.patch | 112 ++++++++++ ...SVE2-support-to-be-disabled-in-CMake.patch | 91 ++++++++ .../0007-Allow-ARMv7-builds-using-CMake.patch | 86 ++++++++ ...ymbol-error-when-building-TensorInfo.patch | 46 ++++ .../arm-compute-library_24.12.bb | 89 ++++++++ 9 files changed, 1032 insertions(+) create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch new file mode 100644 index 00000000..9e36d254 --- /dev/null +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch @@ -0,0 +1,130 @@ +From 1e4c3016547b5f75e515d4b9a7202733c47f5a18 Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Wed, 4 Dec 2024 14:46:17 -0600 +Subject: [PATCH] fix: Fix indention in cmake generator script + +All other items in these lists use tabs, the first couple +lines should match. Switch them to tabs then regenerate +the CMakeLists.txt file. + +While here fix the missing ending newline. + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +Change-Id: Icab852fc43ae08e7858857881c996d233c835289 +--- + scripts/generate_build_files.py | 27 ++++++++++++++------------- + src/CMakeLists.txt | 26 +++++++++++++------------- + 2 files changed, 27 insertions(+), 26 deletions(-) + +diff --git a/scripts/generate_build_files.py b/scripts/generate_build_files.py +index f88cf1af44..52a8cc14da 100644 +--- a/scripts/generate_build_files.py ++++ b/scripts/generate_build_files.py +@@ -168,28 +168,29 @@ def build_from_template_cmake(srcs_graph, srcs_sve, srcs_sve2, srcs_core): + template = f"""{get_template_header()} + + target_sources( +- arm_compute_graph +- PRIVATE +- {line_separator.join(srcs_graph)} ++ arm_compute_graph ++ PRIVATE ++ {line_separator.join(srcs_graph)} + ) + + target_sources( +- arm_compute_sve +- PRIVATE +- {line_separator.join(srcs_sve)} ++ arm_compute_sve ++ PRIVATE ++ {line_separator.join(srcs_sve)} + ) + + target_sources( +- arm_compute_sve2 +- PRIVATE +- {line_separator.join(srcs_sve2)} ++ arm_compute_sve2 ++ PRIVATE ++ {line_separator.join(srcs_sve2)} + ) + + target_sources( +- arm_compute +- PRIVATE +- {line_separator.join(srcs_core)} +-)""" ++ arm_compute ++ PRIVATE ++ {line_separator.join(srcs_core)} ++) ++""" + return template + + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ff3bed96df..f1b275532a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,9 +21,9 @@ + # SOFTWARE. + + target_sources( +- arm_compute_graph +- PRIVATE +- graph/DataLayerVisitor.cpp ++ arm_compute_graph ++ PRIVATE ++ graph/DataLayerVisitor.cpp + graph/Graph.cpp + graph/GraphBuilder.cpp + graph/GraphContext.cpp +@@ -101,9 +101,9 @@ target_sources( + ) + + target_sources( +- arm_compute_sve +- PRIVATE +- core/NEON/kernels/arm_conv/depthwise/interleaves/sve_s8q_3x3_dot.cpp ++ arm_compute_sve ++ PRIVATE ++ core/NEON/kernels/arm_conv/depthwise/interleaves/sve_s8q_3x3_dot.cpp + core/NEON/kernels/arm_conv/depthwise/interleaves/sve_u8q_3x3_dot.cpp + core/NEON/kernels/arm_conv/depthwise/kernels/sme2_fp16_nhwc_3x3_s1_output2x2_mla_depthfirst/generic_direct.cpp + core/NEON/kernels/arm_conv/depthwise/kernels/sme2_fp16_nhwc_3x3_s1_output2x2_mla_depthfirst/generic_indirect.cpp +@@ -332,9 +332,9 @@ target_sources( + ) + + target_sources( +- arm_compute_sve2 +- PRIVATE +- cpu/kernels/activation/generic/sve2/lut.cpp ++ arm_compute_sve2 ++ PRIVATE ++ cpu/kernels/activation/generic/sve2/lut.cpp + cpu/kernels/activation/generic/sve2/qasymm8.cpp + cpu/kernels/activation/generic/sve2/qasymm8_signed.cpp + cpu/kernels/activation/generic/sve2/qsymm16.cpp +@@ -357,9 +357,9 @@ target_sources( + ) + + target_sources( +- arm_compute +- PRIVATE +- c/AclContext.cpp ++ arm_compute ++ PRIVATE ++ c/AclContext.cpp + c/AclOperator.cpp + c/AclQueue.cpp + c/AclTensor.cpp +@@ -1049,4 +1049,4 @@ target_sources( + runtime/experimental/operators/CpuSub.cpp + runtime/experimental/operators/CpuTranspose.cpp + runtime/experimental/operators/CpuWinogradConv2d.cpp +-) +\ No newline at end of file ++) diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch new file mode 100644 index 00000000..174327c5 --- /dev/null +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch @@ -0,0 +1,114 @@ +From 4350c56d14b7b68acd060d8331f3ade1fb74e167 Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 5 Dec 2024 09:21:23 -0600 +Subject: [PATCH] Use ARM_COMPUTE_ENABLE_NEON in code for checking NEON support + +ENABLE_NEON is a flag used by the build systems. The flag is not used +in code, instead ARM_COMPUTE_ENABLE_NEON is used everywhere. + +Drop the ENABLE_NEON compiler definition to prevent any accidental +use in code. + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +Change-Id: I65f5e7411c99280e2dd8c187140909cefd1c6892 +--- + Android.bp | 1 - + BUILD.bazel | 1 - + SConscript | 2 +- + SConstruct | 2 +- + cmake/Options.cmake | 6 +----- + scripts/generate_android_bp.py | 1 - + 6 files changed, 3 insertions(+), 10 deletions(-) + +diff --git a/Android.bp b/Android.bp +index 69379472b0..9288bba2d4 100644 +--- a/Android.bp ++++ b/Android.bp +@@ -157,7 +157,6 @@ arm_compute_library_defaults { + "-DEMBEDDED_KERNELS", + "-DARM_COMPUTE_ASSERTS_ENABLED", + "-DARM_COMPUTE_CPP_SCHEDULER", +- "-DENABLE_NEON", + "-DARM_COMPUTE_ENABLE_NEON", + "-Wno-unused-parameter", + "-DNO_DOT_IN_TOOLCHAIN", +diff --git a/BUILD.bazel b/BUILD.bazel +index f553b7bfad..2262a09655 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -170,7 +170,6 @@ config_setting( + cc_library( + name = "common_defines", + defines = [ +- "ENABLE_NEON", + "ARM_COMPUTE_CPU_ENABLED", + "ARM_COMPUTE_ENABLE_NEON", + "ARM_COMPUTE_ENABLE_I8MM", +diff --git a/SConscript b/SConscript +index 12e8fd1025..69a564873f 100644 +--- a/SConscript ++++ b/SConscript +@@ -97,7 +97,7 @@ def build_multiisa_lib_objects(): + + # note that ARM_COMPUTE_ENABLE_FP16 is enabled in update_data_type_layout_flags() to make + # sure the environment is progated to the validation suite +- arm_compute_env.Append(CPPDEFINES = ['ENABLE_NEON', 'ARM_COMPUTE_ENABLE_NEON', ++ arm_compute_env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_NEON', + 'ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE','ARM_COMPUTE_ENABLE_BF16', + 'ARM_COMPUTE_ENABLE_I8MM', 'ARM_COMPUTE_ENABLE_SVEF32MM']) + +diff --git a/SConstruct b/SConstruct +index 8d7bd291e8..7381300fc8 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -302,7 +302,7 @@ if 'v7a' in env['estate'] and env['estate'] == '64': + print("ERROR: armv7a architecture has only 32-bit execution state") + Exit(1) + +-env.Append(CPPDEFINES = ['ENABLE_NEON', 'ARM_COMPUTE_ENABLE_NEON']) ++env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_NEON']) + + if 'sve' in env['arch']: + env.Append(CPPDEFINES = ['ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE']) +diff --git a/cmake/Options.cmake b/cmake/Options.cmake +index 5d685be48d..121d527718 100644 +--- a/cmake/Options.cmake ++++ b/cmake/Options.cmake +@@ -53,7 +53,6 @@ option(ARM_COMPUTE_ENABLE_SVE_VALIDATION "" OFF) + + option(ENABLE_NEON "Enable Arm® Neon™ support" ON) + option(ARM_COMPUTE_CPU_ENABLED "" ON) +-option(ARM_COMPUTE_ENABLE_NEON "" ON) + option(ARM_COMPUTE_ENABLE_I8MM "" ON) + option(ENABLE_FP32_KERNELS "" ON) + option(ENABLE_QASYMM8_KERNELS "" ON) +@@ -70,14 +69,11 @@ option(ENABLE_FP16_KERNELS "" OFF) + option(ARM_COMPUTE_ENABLE_FP16 "" OFF) + + if(ENABLE_NEON) +- add_definitions(-DENABLE_NEON) ++ add_definitions(-DARM_COMPUTE_ENABLE_NEON) + endif() + if(ARM_COMPUTE_CPU_ENABLED) + add_definitions(-DARM_COMPUTE_CPU_ENABLED) + endif() +-if(ARM_COMPUTE_ENABLE_NEON) +- add_definitions(-DARM_COMPUTE_ENABLE_NEON) +-endif() + if(ARM_COMPUTE_ENABLE_FP16) + add_definitions(-DARM_COMPUTE_ENABLE_FP16) + endif() +diff --git a/scripts/generate_android_bp.py b/scripts/generate_android_bp.py +index d5b268f522..99a04e7071 100755 +--- a/scripts/generate_android_bp.py ++++ b/scripts/generate_android_bp.py +@@ -94,7 +94,6 @@ arm_compute_library_defaults { + "-DEMBEDDED_KERNELS", + "-DARM_COMPUTE_ASSERTS_ENABLED", + "-DARM_COMPUTE_CPP_SCHEDULER", +- "-DENABLE_NEON", + "-DARM_COMPUTE_ENABLE_NEON", + "-Wno-unused-parameter", + "-DNO_DOT_IN_TOOLCHAIN", diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch new file mode 100644 index 00000000..b51e4534 --- /dev/null +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch @@ -0,0 +1,197 @@ +From 92a881cebfee5504b188a046a96d39dd9361ddb1 Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 5 Dec 2024 08:57:38 -0600 +Subject: [PATCH] Use ARM_COMPUTE_ENABLE_SVE in code for checking SVE support + +ENABLE_SVE is a flag used by the build systems. The flag used in code +is ARM_COMPUTE_ENABLE_SVE. There are just a couple spots where the +build system flag is used instead causing the need to define both. + +Switch these last users of ENABLE_SVE over to ARM_COMPUTE_ENABLE_SVE +then drop the ENABLE_SVE definition to prevent any more instances +being added in the future. + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +Change-Id: I00da7580c4520647b62c6989bc7fbdd5efc7935e +--- + BUILD.bazel | 3 --- + SConscript | 2 +- + SConstruct | 2 +- + .../batchnormalization/impl/SVE/fp16.cpp | 2 +- + .../batchnormalization/impl/SVE/fp32.cpp | 2 +- + tests/BUILD.bazel | 1 - + tests/validation/NEON/ActivationLayer.cpp | 24 +++++++++---------- + tests/validation/NEON/ArithmeticAddition.cpp | 6 ++--- + 8 files changed, 19 insertions(+), 23 deletions(-) + +diff --git a/BUILD.bazel b/BUILD.bazel +index 2262a09655..c04a52e084 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -297,7 +297,6 @@ cc_library( + "//conditions:default": [], + }), + local_defines = [ +- "ENABLE_SVE", + "ARM_COMPUTE_ENABLE_SVE", + "ARM_COMPUTE_ENABLE_SVE2", + "ARM_COMPUTE_ENABLE_BF16", +@@ -348,7 +347,6 @@ cc_library( + "//conditions:default": [], + }), + local_defines = [ +- "ENABLE_SVE", + "ARM_COMPUTE_ENABLE_SVE", + "ARM_COMPUTE_ENABLE_BF16", + ], +@@ -409,7 +407,6 @@ cc_library( + "//conditions:default": [], + }), + local_defines = [ +- "ENABLE_SVE", + "ARM_COMPUTE_ENABLE_SVE", + "ARM_COMPUTE_ENABLE_BF16", + ], +diff --git a/SConscript b/SConscript +index 69a564873f..c2ca549b71 100644 +--- a/SConscript ++++ b/SConscript +@@ -98,7 +98,7 @@ def build_multiisa_lib_objects(): + # note that ARM_COMPUTE_ENABLE_FP16 is enabled in update_data_type_layout_flags() to make + # sure the environment is progated to the validation suite + arm_compute_env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_NEON', +- 'ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE','ARM_COMPUTE_ENABLE_BF16', ++ 'ARM_COMPUTE_ENABLE_SVE','ARM_COMPUTE_ENABLE_BF16', + 'ARM_COMPUTE_ENABLE_I8MM', 'ARM_COMPUTE_ENABLE_SVEF32MM']) + + # Build all the common files for the base architecture +diff --git a/SConstruct b/SConstruct +index 7381300fc8..17f5615acf 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -305,7 +305,7 @@ if 'v7a' in env['estate'] and env['estate'] == '64': + env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_NEON']) + + if 'sve' in env['arch']: +- env.Append(CPPDEFINES = ['ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE']) ++ env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_SVE']) + if 'sve2' in env['arch']: + env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_SVE2']) + +diff --git a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp +index 48caaa3e63..e07593312c 100644 +--- a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp ++++ b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp16.cpp +@@ -128,4 +128,4 @@ void fp16_sve_batch_normalization(ITensor *src, + } + } // namespace cpu + } // namespace arm_compute +-#endif // ENABLE_SVE ++#endif // ARM_COMPUTE_ENABLE_SVE +diff --git a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp +index df4fbfe607..0d52d2c3c0 100644 +--- a/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp ++++ b/src/core/NEON/kernels/batchnormalization/impl/SVE/fp32.cpp +@@ -128,4 +128,4 @@ void fp32_sve_batch_normalization(ITensor *src, + } + } // namespace cpu + } // namespace arm_compute +-#endif // ENABLE_SVE ++#endif // ARM_COMPUTE_ENABLE_SVE +diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel +index 7085f1facc..4b4be8b257 100644 +--- a/tests/BUILD.bazel ++++ b/tests/BUILD.bazel +@@ -114,7 +114,6 @@ cc_binary( + }) + + select({ + "//:sve_validation_flag": [ +- "ENABLE_SVE", + "ARM_COMPUTE_ENABLE_SVE", + ], + "//conditions:default": [], +diff --git a/tests/validation/NEON/ActivationLayer.cpp b/tests/validation/NEON/ActivationLayer.cpp +index 119d51808a..69a8b52354 100644 +--- a/tests/validation/NEON/ActivationLayer.cpp ++++ b/tests/validation/NEON/ActivationLayer.cpp +@@ -73,11 +73,11 @@ RelativeTolerance relative_tolerance(DataType data_type, ActivationLayerI + switch(data_type) + { + case DataType::F16: +-#if defined(ENABLE_SVE) ++#if defined(ARM_COMPUTE_ENABLE_SVE) + return RelativeTolerance(0.25f); +-#else // !defined(ENABLE_SVE) ++#else // !defined(ARM_COMPUTE_ENABLE_SVE) + return RelativeTolerance(0.1f); +-#endif // defined(ENABLE_SVE) ++#endif // defined(ARM_COMPUTE_ENABLE_SVE) + default: + return RelativeTolerance(0.05f); + } +@@ -85,11 +85,11 @@ RelativeTolerance relative_tolerance(DataType data_type, ActivationLayerI + switch(data_type) + { + case DataType::F16: +-#if defined(ENABLE_SVE) ++#if defined(ARM_COMPUTE_ENABLE_SVE) + return RelativeTolerance(0.9f); +-#else // !defined(ENABLE_SVE) ++#else // !defined(ARM_COMPUTE_ENABLE_SVE) + return RelativeTolerance(0.01f); +-#endif // defined(ENABLE_SVE) ++#endif // defined(ARM_COMPUTE_ENABLE_SVE) + default: + return RelativeTolerance(0.00001f); + } +@@ -117,11 +117,11 @@ AbsoluteTolerance absolute_tolerance(DataType data_type, ActivationLayerI + switch(data_type) + { + case DataType::F16: +-#if defined(ENABLE_SVE) ++#if defined(ARM_COMPUTE_ENABLE_SVE) + return AbsoluteTolerance(0.25f); +-#else // !defined(ENABLE_SVE) ++#else // !defined(ARM_COMPUTE_ENABLE_SVE) + return AbsoluteTolerance(0.01f); +-#endif // defined(ENABLE_SVE) ++#endif // defined(ARM_COMPUTE_ENABLE_SVE) + default: + return AbsoluteTolerance(0.00001f); + } +@@ -129,11 +129,11 @@ AbsoluteTolerance absolute_tolerance(DataType data_type, ActivationLayerI + switch(data_type) + { + case DataType::F16: +-#if defined(ENABLE_SVE) ++#if defined(ARM_COMPUTE_ENABLE_SVE) + return AbsoluteTolerance(0.9f); +-#else // !defined(ENABLE_SVE) ++#else // !defined(ARM_COMPUTE_ENABLE_SVE) + return AbsoluteTolerance(0.01f); +-#endif // defined(ENABLE_SVE) ++#endif // defined(ARM_COMPUTE_ENABLE_SVE) + default: + return AbsoluteTolerance(0.00001f); + } +diff --git a/tests/validation/NEON/ArithmeticAddition.cpp b/tests/validation/NEON/ArithmeticAddition.cpp +index c0033daab0..bae8535ff3 100644 +--- a/tests/validation/NEON/ArithmeticAddition.cpp ++++ b/tests/validation/NEON/ArithmeticAddition.cpp +@@ -48,11 +48,11 @@ namespace validation + using framework::dataset::make; + namespace + { +-#if !defined(__aarch64__) || defined(ENABLE_SVE) ++#if !defined(__aarch64__) || defined(ARM_COMPUTE_ENABLE_SVE) + constexpr AbsoluteTolerance tolerance_quant(1); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */ +-#else // !defined(__aarch64__) || defined(ENABLE_SVE) ++#else // !defined(__aarch64__) || defined(ARM_COMPUTE_ENABLE_SVE) + constexpr AbsoluteTolerance tolerance_quant(1); +-#endif // !defined(__aarch64__) || defined(ENABLE_SVE) ++#endif // !defined(__aarch64__) || defined(ARM_COMPUTE_ENABLE_SVE) + const auto InPlaceDataSet = framework::dataset::make("InPlace", { false, true }); + const auto OutOfPlaceDataSet = framework::dataset::make("InPlace", { false }); + } // namespace diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch new file mode 100644 index 00000000..971658b4 --- /dev/null +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch @@ -0,0 +1,167 @@ +From a3c7d6aefc289dcce6656fc6d9f9c8c9b1af8f0b Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 5 Dec 2024 09:38:26 -0600 +Subject: [PATCH] Add source files at library definition time + +This allows for easier conditional disabling of these libraries. + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +Change-Id: I442aaa03060f2cb7db4ed0c1d93e64dbc223fdc6 +--- + CMakeLists.txt | 20 ++++++++++---------- + scripts/generate_build_files.py | 16 ++++------------ + src/CMakeLists.txt | 16 ++++------------ + 3 files changed, 18 insertions(+), 34 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e8bdf2af1a..4073e06b17 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,6 +46,12 @@ set(CMAKE_CXX_EXTENSIONS OFF) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Options.cmake) + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Version.cmake) ++include(${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt) ++ ++list(TRANSFORM ARM_COMPUTE_GRAPH_SOURCES PREPEND "src/") ++list(TRANSFORM ARM_COMPUTE_SVE_SOURCES PREPEND "src/") ++list(TRANSFORM ARM_COMPUTE_SVE2_SOURCES PREPEND "src/") ++list(TRANSFORM ARM_COMPUTE_SOURCES PREPEND "src/") + + # Require at least gcc/g++ 11) CMAKE_CXX_COMPILER_VERSION OR + if(CMAKE_C_COMPILER_VERSION VERSION_LESS 10.2 OR CMAKE_CXX_COMPILER_VERSION +@@ -139,8 +145,7 @@ endif() + + # --------------------------------------------------------------------- + # SVE Object Library +- +-add_library(arm_compute_sve OBJECT "") ++add_library(arm_compute_sve OBJECT ${ARM_COMPUTE_SVE_SOURCES}) + target_compile_options(arm_compute_sve + PRIVATE "-march=armv8.2-a+sve+fp16+dotprod" + PRIVATE "-fPIC") +@@ -162,8 +167,7 @@ target_include_directories( + + # --------------------------------------------------------------------- + # SVE2 Object Library +- +-add_library(arm_compute_sve2 OBJECT "") ++add_library(arm_compute_sve2 OBJECT ${ARM_COMPUTE_SVE2_SOURCES}) + target_compile_options(arm_compute_sve2 + PRIVATE "-march=armv8.6-a+sve2+fp16+dotprod" + PRIVATE "-fPIC") +@@ -187,7 +191,7 @@ target_include_directories( + # --------------------------------------------------------------------- + # Core Library + +-add_library(arm_compute "") ++add_library(arm_compute ${ARM_COMPUTE_SOURCES}) + target_compile_options(arm_compute PRIVATE "-march=${ARM_COMPUTE_ARCH}") + target_compile_definitions(arm_compute PRIVATE ARM_COMPUTE_ENABLE_BF16) + target_compile_definitions(arm_compute PRIVATE ENABLE_SVE) +@@ -216,7 +220,7 @@ target_link_libraries( + # --------------------------------------------------------------------- + # Graph Library + +-add_library(arm_compute_graph "") ++add_library(arm_compute_graph ${ARM_COMPUTE_GRAPH_SOURCES}) + target_compile_options(arm_compute_graph PRIVATE "-march=${ARM_COMPUTE_ARCH}") + target_compile_definitions(arm_compute_graph PRIVATE ENABLE_SVE) + target_compile_definitions(arm_compute_graph PRIVATE ARM_COMPUTE_ENABLE_SVE) +@@ -238,10 +242,6 @@ target_compile_options(arm_compute_graph PUBLIC ${COMMON_CXX_FLAGS}) + + add_library(ArmCompute::Graph ALIAS arm_compute_graph) + +-# --------------------------------------------------------------------- +-# Library Target Sources +-add_subdirectory(src) +- + if(ARM_COMPUTE_BUILD_TESTING) + # --------------------------------------------------------------------- + # Validation Framework Library +diff --git a/scripts/generate_build_files.py b/scripts/generate_build_files.py +index 52a8cc14da..4c4a14623f 100644 +--- a/scripts/generate_build_files.py ++++ b/scripts/generate_build_files.py +@@ -167,27 +167,19 @@ def build_from_template_cmake(srcs_graph, srcs_sve, srcs_sve2, srcs_core): + + template = f"""{get_template_header()} + +-target_sources( +- arm_compute_graph +- PRIVATE ++set(ARM_COMPUTE_GRAPH_SOURCES + {line_separator.join(srcs_graph)} + ) + +-target_sources( +- arm_compute_sve +- PRIVATE ++set(ARM_COMPUTE_SVE_SOURCES + {line_separator.join(srcs_sve)} + ) + +-target_sources( +- arm_compute_sve2 +- PRIVATE ++set(ARM_COMPUTE_SVE2_SOURCES + {line_separator.join(srcs_sve2)} + ) + +-target_sources( +- arm_compute +- PRIVATE ++set(ARM_COMPUTE_SOURCES + {line_separator.join(srcs_core)} + ) + """ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index f1b275532a..73871563e1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -20,9 +20,7 @@ + # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + # SOFTWARE. + +-target_sources( +- arm_compute_graph +- PRIVATE ++set(ARM_COMPUTE_GRAPH_SOURCES + graph/DataLayerVisitor.cpp + graph/Graph.cpp + graph/GraphBuilder.cpp +@@ -100,9 +98,7 @@ target_sources( + graph/printers/DotGraphPrinter.cpp + ) + +-target_sources( +- arm_compute_sve +- PRIVATE ++set(ARM_COMPUTE_SVE_SOURCES + core/NEON/kernels/arm_conv/depthwise/interleaves/sve_s8q_3x3_dot.cpp + core/NEON/kernels/arm_conv/depthwise/interleaves/sve_u8q_3x3_dot.cpp + core/NEON/kernels/arm_conv/depthwise/kernels/sme2_fp16_nhwc_3x3_s1_output2x2_mla_depthfirst/generic_direct.cpp +@@ -331,9 +327,7 @@ target_sources( + cpu/kernels/softmax/generic/sve/impl_bf16.cpp + ) + +-target_sources( +- arm_compute_sve2 +- PRIVATE ++set(ARM_COMPUTE_SVE2_SOURCES + cpu/kernels/activation/generic/sve2/lut.cpp + cpu/kernels/activation/generic/sve2/qasymm8.cpp + cpu/kernels/activation/generic/sve2/qasymm8_signed.cpp +@@ -356,9 +350,7 @@ target_sources( + cpu/kernels/softmax/generic/sve2/impl.cpp + ) + +-target_sources( +- arm_compute +- PRIVATE ++set(ARM_COMPUTE_SOURCES + c/AclContext.cpp + c/AclOperator.cpp + c/AclQueue.cpp diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch new file mode 100644 index 00000000..29ca02f5 --- /dev/null +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch @@ -0,0 +1,112 @@ +From cdb765df59d8ce5f388ac2a820b5da76eb8d610c Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 5 Dec 2024 09:47:25 -0600 +Subject: [PATCH] Add CMake options for SVE, SVE2, and BF16 support + +These should be optional, add options for these. Remove the hard-coded +definitions of these for the libraries. This also makes it so validation +options are not needed, if SVE is enabled it will be validated. + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +Change-Id: I03182ac6ece843e813c027ef6a573cbba254dee9 +--- + CMakeLists.txt | 19 ------------------- + cmake/Options.cmake | 16 +++++++++++++--- + 2 files changed, 13 insertions(+), 22 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4073e06b17..4d95fb1bfd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -149,9 +149,6 @@ add_library(arm_compute_sve OBJECT ${ARM_COMPUTE_SVE_SOURCES}) + target_compile_options(arm_compute_sve + PRIVATE "-march=armv8.2-a+sve+fp16+dotprod" + PRIVATE "-fPIC") +-target_compile_definitions(arm_compute_sve PRIVATE ARM_COMPUTE_ENABLE_BF16) +-target_compile_definitions(arm_compute_sve PRIVATE ENABLE_SVE) +-target_compile_definitions(arm_compute_sve PRIVATE ARM_COMPUTE_ENABLE_SVE) + target_include_directories( + arm_compute_sve + PUBLIC $ +@@ -171,10 +168,6 @@ add_library(arm_compute_sve2 OBJECT ${ARM_COMPUTE_SVE2_SOURCES}) + target_compile_options(arm_compute_sve2 + PRIVATE "-march=armv8.6-a+sve2+fp16+dotprod" + PRIVATE "-fPIC") +-target_compile_definitions(arm_compute_sve2 PRIVATE ARM_COMPUTE_ENABLE_SVE2) +-target_compile_definitions(arm_compute_sve2 PRIVATE ARM_COMPUTE_ENABLE_BF16) +-target_compile_definitions(arm_compute_sve2 PRIVATE ENABLE_SVE) +-target_compile_definitions(arm_compute_sve2 PRIVATE ARM_COMPUTE_ENABLE_SVE) + target_include_directories( + arm_compute_sve2 + PUBLIC $ +@@ -193,9 +186,6 @@ target_include_directories( + + add_library(arm_compute ${ARM_COMPUTE_SOURCES}) + target_compile_options(arm_compute PRIVATE "-march=${ARM_COMPUTE_ARCH}") +-target_compile_definitions(arm_compute PRIVATE ARM_COMPUTE_ENABLE_BF16) +-target_compile_definitions(arm_compute PRIVATE ENABLE_SVE) +-target_compile_definitions(arm_compute PRIVATE ARM_COMPUTE_ENABLE_SVE) + target_include_directories( + arm_compute + PUBLIC $ +@@ -222,8 +212,6 @@ target_link_libraries( + + add_library(arm_compute_graph ${ARM_COMPUTE_GRAPH_SOURCES}) + target_compile_options(arm_compute_graph PRIVATE "-march=${ARM_COMPUTE_ARCH}") +-target_compile_definitions(arm_compute_graph PRIVATE ENABLE_SVE) +-target_compile_definitions(arm_compute_graph PRIVATE ARM_COMPUTE_ENABLE_SVE) + # add_subdirectory(src/graph) + + target_include_directories( +@@ -268,13 +256,6 @@ if(ARM_COMPUTE_BUILD_TESTING) + + add_executable(arm_compute_validation "") + target_compile_options(arm_compute_validation PRIVATE "-march=${ARM_COMPUTE_ARCH}") +- if(ARM_COMPUTE_ENABLE_BF16_VALIDATION) +- target_compile_definitions(arm_compute_validation PRIVATE ARM_COMPUTE_ENABLE_BF16) +- endif() +- if(ARM_COMPUTE_ENABLE_SVE_VALIDATION) +- target_compile_definitions(arm_compute_validation PRIVATE ENABLE_SVE) +- target_compile_definitions(arm_compute_validation PRIVATE ARM_COMPUTE_ENABLE_SVE) +- endif() + add_subdirectory(tests/validation) + target_compile_options(arm_compute_validation PUBLIC ${COMMON_CXX_FLAGS}) + set_target_properties( +diff --git a/cmake/Options.cmake b/cmake/Options.cmake +index 121d527718..5c23fcb490 100644 +--- a/cmake/Options.cmake ++++ b/cmake/Options.cmake +@@ -48,11 +48,12 @@ set(ARM_COMPUTE_ARCH armv8-a CACHE STRING "Architecture to use") + # --------------------------------------------------------------------- + # Backends + +-option(ARM_COMPUTE_ENABLE_BF16_VALIDATION "" ON) +-option(ARM_COMPUTE_ENABLE_SVE_VALIDATION "" OFF) +- + option(ENABLE_NEON "Enable Arm® Neon™ support" ON) ++option(ENABLE_SVE "Enable Arm® SVE support" ON) ++option(ENABLE_SVE2 "Enable Arm® SVE2 support" ON) ++ + option(ARM_COMPUTE_CPU_ENABLED "" ON) ++option(ARM_COMPUTE_ENABLE_BF16 "" ON) + option(ARM_COMPUTE_ENABLE_I8MM "" ON) + option(ENABLE_FP32_KERNELS "" ON) + option(ENABLE_QASYMM8_KERNELS "" ON) +@@ -74,6 +75,15 @@ endif() + if(ARM_COMPUTE_CPU_ENABLED) + add_definitions(-DARM_COMPUTE_CPU_ENABLED) + endif() ++if(ENABLE_SVE) ++ add_definitions(-DARM_COMPUTE_ENABLE_SVE) ++endif() ++if(ENABLE_SVE2) ++ add_definitions(-DARM_COMPUTE_ENABLE_SVE2) ++endif() ++if(ARM_COMPUTE_ENABLE_BF16) ++ add_definitions(-DARM_COMPUTE_ENABLE_BF16) ++endif() + if(ARM_COMPUTE_ENABLE_FP16) + add_definitions(-DARM_COMPUTE_ENABLE_FP16) + endif() diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch new file mode 100644 index 00000000..06370adb --- /dev/null +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch @@ -0,0 +1,91 @@ +From ab5bf5b8f86337a31bfd48277650f583a040e658 Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 5 Dec 2024 09:59:48 -0600 +Subject: [PATCH] Allow SVE and SVE2 support to be disabled in CMake + +Currently these are hard-coded as enabled. The SVE and SVE2 libraries +are built unconditionally. These should only be built when SVE or +SVE2 is available. + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +Change-Id: I176259f872a84f736028622694d65d4c5b57e379 +--- + CMakeLists.txt | 25 ++++++++++++++++++------- + 1 file changed, 18 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4d95fb1bfd..d233d6bc67 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -145,6 +145,7 @@ endif() + + # --------------------------------------------------------------------- + # SVE Object Library ++if(ENABLE_SVE) + add_library(arm_compute_sve OBJECT ${ARM_COMPUTE_SVE_SOURCES}) + target_compile_options(arm_compute_sve + PRIVATE "-march=armv8.2-a+sve+fp16+dotprod" +@@ -161,9 +162,11 @@ target_include_directories( + src/core/cpu/kernels/assembly + src/cpu/kernels/assembly + src/core/NEON/kernels/arm_gemm/merges) ++endif() # ENABLE_SVE + + # --------------------------------------------------------------------- + # SVE2 Object Library ++if(ENABLE_SVE2) + add_library(arm_compute_sve2 OBJECT ${ARM_COMPUTE_SVE2_SOURCES}) + target_compile_options(arm_compute_sve2 + PRIVATE "-march=armv8.6-a+sve2+fp16+dotprod" +@@ -180,6 +183,7 @@ target_include_directories( + src/core/cpu/kernels/assembly + src/cpu/kernels/assembly + src/core/NEON/kernels/arm_gemm/merges) ++endif() # ENABLE_SVE2 + + # --------------------------------------------------------------------- + # Core Library +@@ -203,9 +207,12 @@ target_compile_options(arm_compute PUBLIC ${COMMON_CXX_FLAGS}) + add_library(ArmCompute::Core ALIAS arm_compute) + + # arm_compute_sve and arm_compute_sve2 obj files will not be public in the arm_compute.so +-target_link_libraries( +- arm_compute PRIVATE $ +- PRIVATE $) ++if(ENABLE_SVE) ++ target_link_libraries(arm_compute PRIVATE $) ++endif() ++if(ENABLE_SVE2) ++ target_link_libraries(arm_compute PRIVATE $) ++endif() + + # --------------------------------------------------------------------- + # Graph Library +@@ -263,8 +270,10 @@ if(ARM_COMPUTE_BUILD_TESTING) + "${CMAKE_BINARY_DIR}/validation") + target_link_libraries( + arm_compute_validation +- PUBLIC arm_compute arm_compute_graph arm_compute_validation_framework +- arm_compute_sve) ++ PUBLIC arm_compute arm_compute_graph arm_compute_validation_framework) ++ if(ENABLE_SVE) ++ target_link_libraries(arm_compute_validation PUBLIC arm_compute_sve) ++ endif() + target_link_directories(arm_compute_validation PUBLIC tests) + + # --------------------------------------------------------------------- +@@ -299,8 +308,10 @@ if(ARM_COMPUTE_BUILD_EXAMPLES) + set_target_properties( + ${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY + "${CMAKE_BINARY_DIR}/examples") +- target_link_libraries(${test_name} PUBLIC arm_compute +- arm_compute_graph arm_compute_sve) ++ target_link_libraries(${test_name} PUBLIC arm_compute arm_compute_graph) ++ if(ENABLE_SVE) ++ target_link_libraries(${test_name} PUBLIC arm_compute_sve) ++ endif() + endforeach() + + # NEON Examples diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch new file mode 100644 index 00000000..07dd4bee --- /dev/null +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch @@ -0,0 +1,86 @@ +From 416cffe2a75a4ec66a75e00bc00297f2f0187e0f Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 5 Dec 2024 10:05:03 -0600 +Subject: [PATCH] Allow ARMv7 builds using CMake + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +Change-Id: Ib6bae5820569a8eadd53afdfe31e611a3089140e +--- + CMakeLists.txt | 25 +++++++++++++++++-- + .../fixtures/CpuGemmAssemblyDispatchFixture.h | 3 +++ + 2 files changed, 26 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d233d6bc67..4fc27553f3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -148,7 +148,7 @@ endif() + if(ENABLE_SVE) + add_library(arm_compute_sve OBJECT ${ARM_COMPUTE_SVE_SOURCES}) + target_compile_options(arm_compute_sve +- PRIVATE "-march=armv8.2-a+sve+fp16+dotprod" ++ PRIVATE "-march=${ARM_COMPUTE_ARCH}" + PRIVATE "-fPIC") + target_include_directories( + arm_compute_sve +@@ -169,7 +169,7 @@ endif() # ENABLE_SVE + if(ENABLE_SVE2) + add_library(arm_compute_sve2 OBJECT ${ARM_COMPUTE_SVE2_SOURCES}) + target_compile_options(arm_compute_sve2 +- PRIVATE "-march=armv8.6-a+sve2+fp16+dotprod" ++ PRIVATE "-march=${ARM_COMPUTE_ARCH}" + PRIVATE "-fPIC") + target_include_directories( + arm_compute_sve2 +@@ -204,6 +204,15 @@ target_include_directories( + src/core/NEON/kernels/convolution/winograd) + target_compile_options(arm_compute PUBLIC ${COMMON_CXX_FLAGS}) + ++if(ARM_COMPUTE_ARCH MATCHES "armv7") ++ target_sources( ++ arm_compute ++ PRIVATE ++ src/core/NEON/kernels/arm_gemm/kernels/a32_sgemm_8x6/a53.cpp ++ src/core/NEON/kernels/arm_gemm/kernels/a32_sgemm_8x6/a55r1.cpp ++ src/core/NEON/kernels/arm_gemm/kernels/a32_sgemm_8x6/generic.cpp) ++endif() ++ + add_library(ArmCompute::Core ALIAS arm_compute) + + # arm_compute_sve and arm_compute_sve2 obj files will not be public in the arm_compute.so +@@ -264,6 +273,18 @@ if(ARM_COMPUTE_BUILD_TESTING) + add_executable(arm_compute_validation "") + target_compile_options(arm_compute_validation PRIVATE "-march=${ARM_COMPUTE_ARCH}") + add_subdirectory(tests/validation) ++ target_include_directories( ++ arm_compute_validation ++ PUBLIC $ ++ $ ++ ${CMAKE_CURRENT_SOURCE_DIR} ++ PRIVATE src ++ src/cpu/kernels/assembly ++ src/core/NEON/kernels/arm_gemm ++ src/core/NEON/kernels/assembly ++ src/core/NEON/kernels/convolution/common ++ src/core/NEON/kernels/arm_conv/depthwise ++ src/core/NEON/kernels/convolution/winograd) + target_compile_options(arm_compute_validation PUBLIC ${COMMON_CXX_FLAGS}) + set_target_properties( + arm_compute_validation PROPERTIES RUNTIME_OUTPUT_DIRECTORY +diff --git a/tests/validation/fixtures/CpuGemmAssemblyDispatchFixture.h b/tests/validation/fixtures/CpuGemmAssemblyDispatchFixture.h +index 5d74e210d5..0b45cdf356 100644 +--- a/tests/validation/fixtures/CpuGemmAssemblyDispatchFixture.h ++++ b/tests/validation/fixtures/CpuGemmAssemblyDispatchFixture.h +@@ -25,7 +25,10 @@ + #define ACL_TESTS_VALIDATION_FIXTURES_CPUGEMMASSEMBLYDISPATCHFIXTURE_H + + #include "arm_compute/core/Helpers.h" ++ ++#ifdef ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS + #include "arm_compute/runtime/NEON/functions/NEReorderLayer.h" ++#endif //ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS + #include "arm_compute/runtime/NEON/functions/NETranspose.h" + + #include "src/core/NEON/kernels/arm_gemm/utils.hpp" diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch new file mode 100644 index 00000000..9883a44d --- /dev/null +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch @@ -0,0 +1,46 @@ +From 58698788adaeb2f74cf9fcddf06f3e9a2e78b984 Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Mon, 16 Dec 2024 09:42:22 -0600 +Subject: [PATCH] Fix undefined symbol error when building TensorInfo + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +Change-Id: I657d1b7faaad94147c685c4826916d3c21da82e1 +--- + arm_compute/core/TensorInfo.h | 5 +---- + src/core/TensorInfo.cpp | 5 +++++ + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/arm_compute/core/TensorInfo.h b/arm_compute/core/TensorInfo.h +index e4c9cbe879..2bfe83c4b1 100644 +--- a/arm_compute/core/TensorInfo.h ++++ b/arm_compute/core/TensorInfo.h +@@ -242,10 +242,7 @@ public: + { + return _num_channels; + } +- const TensorShape &tensor_shape() const override +- { +- return _tensor_shape; +- } ++ const TensorShape &tensor_shape() const override; + const TensorDimsState &tensor_dims_state() const override + { + return _dims_state; +diff --git a/src/core/TensorInfo.cpp b/src/core/TensorInfo.cpp +index 31bddbde40..884203fd7c 100644 +--- a/src/core/TensorInfo.cpp ++++ b/src/core/TensorInfo.cpp +@@ -395,6 +395,11 @@ ITensorInfo &TensorInfo::set_tensor_dims_state(const TensorDimsState &state) + return *this; + } + ++const TensorShape &TensorInfo::tensor_shape() const ++{ ++ return _tensor_shape; ++} ++ + ITensorInfo &TensorInfo::set_quantization_info(const QuantizationInfo &quantization_info) + { + _quantization_info = quantization_info; diff --git a/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb new file mode 100644 index 00000000..383b02fb --- /dev/null +++ b/meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb @@ -0,0 +1,89 @@ +SUMMARY = "The ARM Computer Vision and Machine Learning library" +DESCRIPTION = "The ARM Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSES/MIT.txt;md5=35f8944fae972976691f3483b0ac9dba" + +SRC_URI = " \ + git://github.com/ARM-software/ComputeLibrary.git;branch=main;protocol=https \ + file://0001-fix-Fix-indention-in-cmake-generator-script.patch \ + file://0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch \ + file://0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch \ + file://0004-Add-source-files-at-library-definition-time.patch \ + file://0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch \ + file://0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch \ + file://0007-Allow-ARMv7-builds-using-CMake.patch \ + file://0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch \ +" +SRCREV = "32bcced2af7feea6969dd1d22e58d0718dc488e3" + +S = "${WORKDIR}/git" + +# Only compatible with armv7, armv7ve, and aarch64 +COMPATIBLE_MACHINE = "(^$)" +COMPATIBLE_MACHINE:aarch64 = "(.*)" +COMPATIBLE_MACHINE:armv7a = "${@bb.utils.contains("TUNE_FEATURES","neon","(.*)","(^$)",d)}" +COMPATIBLE_MACHINE:armv7ve = "${@bb.utils.contains("TUNE_FEATURES","neon","(.*)","(^$)",d)}" + +inherit cmake + +PACKAGECONFIG ??= "examples tests cppthreads openmp" + +PACKAGECONFIG[Werror] = "-DARM_COMPUTE_WERROR=ON,-DARM_COMPUTE_WERROR=OFF" +PACKAGECONFIG[examples] = "-DARM_COMPUTE_BUILD_EXAMPLES=ON,-DARM_COMPUTE_BUILD_EXAMPLES=OFF" +PACKAGECONFIG[tests] = "-DARM_COMPUTE_BUILD_TESTING=ON,-DARM_COMPUTE_BUILD_TESTING=OFF" +PACKAGECONFIG[cppthreads] = "-DARM_COMPUTE_CPPTHREADS=ON,-DARM_COMPUTE_CPPTHREADS=OFF" +PACKAGECONFIG[openmp] = "-DARM_COMPUTE_OPENMP=ON,-DARM_COMPUTE_OPENMP=OFF" + +EXTRA_OECMAKE:append:aarch64 = " \ + -DARM_COMPUTE_ARCH=armv8-a \ + -DENABLE_NEON=ON \ + -DENABLE_SVE=OFF \ + -DENABLE_SVE2=OFF \ +" +EXTRA_OECMAKE:append:arm = " \ + -DARM_COMPUTE_ARCH=armv7-a \ + -DENABLE_NEON=ON \ + -DENABLE_SVE=OFF \ + -DENABLE_SVE2=OFF \ + -DARM_COMPUTE_ENABLE_BF16=OFF \ + -DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS=OFF \ +" + +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" + +# package unversioned .so files in PN (they are not dev symlinks) +FILES_SOLIBSDEV = "" +FILES:${PN} += "${libdir}/*.so" + +# Install headers and examples +do_install:append() { + CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" + + # Install headers + install -d ${D}${includedir} + cp $CP_ARGS ${S}/arm_compute ${D}${includedir} + cp $CP_ARGS ${S}/support ${D}${includedir} + cp $CP_ARGS ${S}/include/half ${D}${includedir} + + # Latest ONNX Runtime uses some headers from the ACL source + install -d ${D}${includedir}/src + (cd ${S}/src; find -type f -name \*.h\* -exec install -D {} ${D}${includedir}/src/{} \;) + + # Install examples + if ${@bb.utils.contains('PACKAGECONFIG', 'examples', 'true', 'false', d)}; then + install -d ${D}${bindir}/${PN}-${PV}/examples + for example in ${B}/examples/*; do + if [ -d "$example" ]; then + continue + fi + case "$example" in + (*.o|*.a|*.cmake) continue;; + esac + install -m 0555 $example ${D}${bindir}/${PN}-${PV}/examples + done + fi +} + +PACKAGES =+ "${PN}-tests ${PN}-examples" +FILES:${PN}-tests += "${libdir}/tests" +FILES:${PN}-examples += "${bindir}/*/examples" From patchwork Fri Jan 17 00:25:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 55692 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46C0DC0218A for ; Fri, 17 Jan 2025 00:25:25 +0000 (UTC) Received: from fllvem-ot03.ext.ti.com (fllvem-ot03.ext.ti.com [198.47.19.245]) by mx.groups.io with SMTP id smtpd.web11.602.1737073524632657718 for ; Thu, 16 Jan 2025 16:25:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ujZXxX9z; spf=pass (domain: ti.com, ip: 198.47.19.245, mailfrom: afd@ti.com) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllvem-ot03.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 50H0PNen090603 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Jan 2025 18:25:23 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1737073523; bh=SoyhIUfNfz/9ZjT63G35W+T4dx2wzKHytF4wP03lYbU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ujZXxX9zfTizhShZ5Qdp1n/qFiytg3GND/JEqMlbvejgUD+kX2lKBvm9NMfrO7BGm DF+UmxWQxFd/ppJ6h57eZnzJK+rD4rp3dcmZN5TCWa4UVncXw21fx82KlAvkMKMNIa v6xY1s/KFPg4OmHFV7n+xAhlvn5e68YbVs9sswlA= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTP id 50H0PNFw094668; Thu, 16 Jan 2025 18:25:23 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 16 Jan 2025 18:25:22 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 16 Jan 2025 18:25:23 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 50H0PLns007059; Thu, 16 Jan 2025 18:25:22 -0600 From: Andrew Davis To: Denys Dmytriyenko , Ryan Eatmon , Chirag Shilwant , CC: Andrew Davis Subject: [meta-arago][scarthgap/master][PATCH 3/6] meta-arago-extras: Add recipe for Arm NN Date: Thu, 16 Jan 2025 18:25:17 -0600 Message-ID: <20250117002520.627504-4-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250117002520.627504-1-afd@ti.com> References: <20250117002520.627504-1-afd@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Jan 2025 00:25:25 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/15702 Arm NN is a performant machine learning inference engine for Linux, accelerating ML on Arm Cortex-A CPUs. Signed-off-by: Andrew Davis --- ...01-Fix-type-casting-for-32bit-builds.patch | 40 +++++++++ .../recipes-devtools/armnn/armnn_24.11.bb | 85 +++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb diff --git a/meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch b/meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch new file mode 100644 index 00000000..8e3cf34d --- /dev/null +++ b/meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch @@ -0,0 +1,40 @@ +From 10953c25a77989709bcbd065489700314fe0c8c6 Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 16 Jan 2025 11:11:28 -0600 +Subject: [PATCH] Fix type casting for 32bit builds + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +Change-Id: Id68274e68e7832b827050a2e417053e88e7a6728 +--- + include/armnn/Numpy.hpp | 2 +- + tests/ExecuteNetwork/FileComparisonExecutor.cpp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/armnn/Numpy.hpp b/include/armnn/Numpy.hpp +index a4154b434..f77b065ca 100644 +--- a/include/armnn/Numpy.hpp ++++ b/include/armnn/Numpy.hpp +@@ -209,7 +209,7 @@ namespace armnnNumpy + template + inline void ReadData(std::ifstream& ifStream, T* tensor, const unsigned int& numElements) + { +- ifStream.read(reinterpret_cast(tensor), sizeof(T) * numElements); ++ ifStream.read(reinterpret_cast(tensor), static_cast(sizeof(T) * numElements)); + } + + +diff --git a/tests/ExecuteNetwork/FileComparisonExecutor.cpp b/tests/ExecuteNetwork/FileComparisonExecutor.cpp +index 903ed0362..4617ebe4a 100644 +--- a/tests/ExecuteNetwork/FileComparisonExecutor.cpp ++++ b/tests/ExecuteNetwork/FileComparisonExecutor.cpp +@@ -187,7 +187,7 @@ Tensor ReadTensorFromFile(const std::string fileName) + + // We'll read the entire file into one buffer. + std::ifstream file(fileName, std::ios::binary); +- std::vector buffer(fileSize); ++ std::vector buffer(static_cast(fileSize)); + if (file.read(buffer.data(), static_cast(fileSize))) + { + std::string tensorName; diff --git a/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb b/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb new file mode 100644 index 00000000..3ba914da --- /dev/null +++ b/meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb @@ -0,0 +1,85 @@ +SUMMARY = "ARM Neural Network SDK" +DESCRIPTION = "Linux software and tools to enable machine learning workloads on power-efficient devices" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3e14a924c16f7d828b8335a59da64074" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +BRANCH = "branches/armnn_24_11" +SRC_URI = "git://github.com/ARM-software/armnn.git;branch=${BRANCH};protocol=https" +SRC_URI += "file://0001-Fix-type-casting-for-32bit-builds.patch" + +# v24.11 +SRCREV = "3ed70c005559d409feff2c578a1a39cf8fec8804" + +S = "${WORKDIR}/git" + +inherit cmake +inherit pkgconfig + +DEPENDS = " \ + boost \ + protobuf \ + xxd-native \ + arm-compute-library \ +" + +RDEPENDS:${PN} = " \ + arm-compute-library \ + protobuf \ + boost \ +" + +PACKAGECONFIG += "unit-tests tests ref" +PACKAGECONFIG += "${@bb.utils.contains('TARGET_ARCH', 'aarch64', 'neon', '', d)}" +PACKAGECONFIG += "${@bb.utils.contains('TARGET_ARCH', 'arm', 'neon', '', d)}" + +PACKAGECONFIG[neon] = " \ + -DARMCOMPUTENEON=1, \ + -DARMCOMPUTENEON=0 \ +" + +PACKAGECONFIG[unit-tests] = " \ + -DBUILD_UNIT_TESTS=1, \ + -DBUILD_UNIT_TESTS=0 \ +" + +PACKAGECONFIG[tests] = " \ + -DBUILD_TESTS=1, \ + -DBUILD_TESTS=0 \ +" + +PACKAGECONFIG[ref] = " \ + -DARMNNREF=1, \ + -DARMNNREF=0 \ +" + +EXTRA_OECMAKE += " \ + -DHALF_INCLUDE=${STAGING_DIR_TARGET} \ +" + +do_install:append() { + CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" + + if ${@bb.utils.contains('PACKAGECONFIG', 'tests', 'true', 'false', d)}; then + install -d ${D}${bindir}/${P} + find ${B}/tests -maxdepth 1 -type f -executable -exec cp $CP_ARGS {} ${D}${bindir}/${P} \; + fi + + if ${@bb.utils.contains('PACKAGECONFIG', 'unit-tests', 'true', 'false', d)}; then + install -d ${D}${bindir}/${P} + cp $CP_ARGS ${B}/UnitTests ${D}${bindir}/${P} + fi + + if ${@bb.utils.contains('PACKAGECONFIG', 'tensorflow-lite', 'false', 'true', d)}; then + rm -rf ${D}${includedir}/armnnTfLiteParser + fi +} + +CXXFLAGS += "-Wno-error=array-bounds -Wno-error=deprecated-declarations -Wno-error=nonnull" + +FILES:${PN} += "${libdir}/*" +FILES:${PN}-dev += "${includedir}/* ${libdir}/cmake/armnn/* ${libdir}/pkgconfig/*.pc ${bindir}/*" + +INSANE_SKIP:${PN} = "dev-so buildpaths" +INSANE_SKIP:${PN}-dev += "dev-elf buildpaths" From patchwork Fri Jan 17 00:25:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 55691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34D0CC02187 for ; Fri, 17 Jan 2025 00:25:25 +0000 (UTC) Received: from lelvem-ot02.ext.ti.com (lelvem-ot02.ext.ti.com [198.47.23.235]) by mx.groups.io with SMTP id smtpd.web10.656.1737073524553376722 for ; Thu, 16 Jan 2025 16:25:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=IfOwsYom; spf=pass (domain: ti.com, ip: 198.47.23.235, mailfrom: afd@ti.com) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelvem-ot02.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 50H0PNbk235679 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jan 2025 18:25:23 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1737073523; bh=zDygtLJUI9GsMOTLjLvi0V6qv7OuWoy9XcKszjDND9Y=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=IfOwsYom2S9Y08jckRhjXMiv1EoLqAWJql86/gpiwn5d0tZlbFFRT4Y1wQ3NJ5jKH ju9jXYIhVVe0DFb6s/mtOausigQ4MjI/TE88KIaz5hgO7bCjxkKMSaRlNj+9wQqNB0 l5Bo/xt5XRL7kuhgWk1f8z8WTMSO+6Cy+jx1TlkI= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 50H0PNYr031835 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 16 Jan 2025 18:25:23 -0600 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 16 Jan 2025 18:25:23 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 16 Jan 2025 18:25:23 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 50H0PLnt007059; Thu, 16 Jan 2025 18:25:23 -0600 From: Andrew Davis To: Denys Dmytriyenko , Ryan Eatmon , Chirag Shilwant , CC: Andrew Davis Subject: [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master Date: Thu, 16 Jan 2025 18:25:18 -0600 Message-ID: <20250117002520.627504-5-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250117002520.627504-1-afd@ti.com> References: <20250117002520.627504-1-afd@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Jan 2025 00:25:25 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/15701 ONNX and ONNX Runtime depend on a very specific version of Abseil that is not the version included with meta-oe scarthgap. But it just so happens to be the version provided in current meta-oe master. Backport this version for our use in scarthgap. This patch is not needed for meta-arago master branch. If meta-oe master at some point moves to a newer incompatible version of Abseil we will deal with this dependency in a different way. Signed-off-by: Andrew Davis --- .../0001-absl-always-use-asm-sgidefs.h.patch | 38 +++++++ ...e-maes-option-from-cross-compilation.patch | 38 +++++++ ...e-neon-option-from-cross-compilation.patch | 49 +++++++++ .../abseil-cpp/0004-abseil-ppc-fixes.patch | 103 ++++++++++++++++++ ...-virtual-dtor-in-the-flags-are-neede.patch | 30 +++++ .../abseil-cpp/abseil-cpp_20240722.0.bb | 54 +++++++++ 6 files changed, 312 insertions(+) create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch new file mode 100644 index 00000000..6fecf256 --- /dev/null +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch @@ -0,0 +1,38 @@ +From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 9 Apr 2020 13:06:27 -0700 +Subject: [PATCH] absl: always use + +Fixes mips/musl build, since sgidefs.h is not present on all C libraries +but on linux asm/sgidefs.h is there and contains same definitions, using +that makes it portable. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + absl/base/internal/direct_mmap.h | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h +index 1beb2ee4..140b0697 100644 +--- a/absl/base/internal/direct_mmap.h ++++ b/absl/base/internal/direct_mmap.h +@@ -41,13 +41,9 @@ + + #ifdef __mips__ + // Include definitions of the ABI currently in use. +-#if defined(__BIONIC__) || !defined(__GLIBC__) +-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the ++// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the + // definitions we need. + #include +-#else +-#include +-#endif // __BIONIC__ || !__GLIBC__ + #endif // __mips__ + + // SYS_mmap and SYS_munmap are not defined in Android. +-- +2.25.1 + diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch new file mode 100644 index 00000000..d49e860f --- /dev/null +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch @@ -0,0 +1,38 @@ +From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001 +From: Sinan Kaya +Date: Mon, 3 Feb 2020 03:25:57 +0000 +Subject: [PATCH] Remove maes option from cross-compilation + +Upstream-Status: Pending +--- + absl/copts/GENERATED_AbseilCopts.cmake | 4 ---- + absl/copts/GENERATED_copts.bzl | 4 ---- + 2 files changed, 8 deletions(-) + +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake +index da2282fe..5e0e8dfd 100644 +--- a/absl/copts/GENERATED_AbseilCopts.cmake ++++ b/absl/copts/GENERATED_AbseilCopts.cmake +@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS + list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS + ) + +-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS +- "-maes" +- "-msse4.1" +-) +diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl +index b9e0071e..0072008c 100644 +--- a/absl/copts/GENERATED_copts.bzl ++++ b/absl/copts/GENERATED_copts.bzl +@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [ + ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [ + ] + +-ABSL_RANDOM_HWAES_X64_FLAGS = [ +- "-maes", +- "-msse4.1", +-] +-- +2.25.1 + diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch new file mode 100644 index 00000000..c82b9e1b --- /dev/null +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch @@ -0,0 +1,49 @@ +From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Thu, 16 Jun 2022 11:46:31 +0000 +Subject: [PATCH] Remove neon option from cross compilation + +Not every arm platform supports neon instructions, so do not enforce +them. + +Upstream-Status: Pending + +Signed-off-by: Jonas Gorski +--- + absl/copts/GENERATED_AbseilCopts.cmake | 4 ---- + absl/copts/GENERATED_copts.bzl | 4 ---- + 2 files changed, 8 deletions(-) + +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake +index 5e0e8dfd..57cfc4d3 100644 +--- a/absl/copts/GENERATED_AbseilCopts.cmake ++++ b/absl/copts/GENERATED_AbseilCopts.cmake +@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS + "/DNOMINMAX" + ) + +-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS +- "-mfpu=neon" +-) +- + list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS + "-march=armv8-a+crypto" + ) +diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl +index 0072008c..72840fda 100644 +--- a/absl/copts/GENERATED_copts.bzl ++++ b/absl/copts/GENERATED_copts.bzl +@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [ + "/DNOMINMAX", + ] + +-ABSL_RANDOM_HWAES_ARM32_FLAGS = [ +- "-mfpu=neon", +-] +- + ABSL_RANDOM_HWAES_ARM64_FLAGS = [ + "-march=armv8-a+crypto", + ] +-- +2.25.1 + diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file mode 100644 index 00000000..ba0cd669 --- /dev/null +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch @@ -0,0 +1,103 @@ +From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 21 Sep 2024 20:53:06 +0800 +Subject: [PATCH] abseil: ppc fixes + +An all-in-one patch that fixes several issues: + +1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl) +2) powerpc stacktrace implementation only works on glibc (disabled on musl) +3) powerpc stacktrace implementation has ppc64 assumptions (fixed) +4) examine_stack.cpp makes glibc assumptions on powerpc (fixed) + +Sourced from void linux + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + absl/base/internal/unscaledcycleclock.cc | 4 ++-- + absl/base/internal/unscaledcycleclock_config.h | 3 ++- + absl/debugging/internal/examine_stack.cc | 8 +++++++- + absl/debugging/internal/stacktrace_config.h | 2 +- + 4 files changed, 12 insertions(+), 5 deletions(-) + +diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc +index a0bf3a65..103b4f6a 100644 +--- a/absl/base/internal/unscaledcycleclock.cc ++++ b/absl/base/internal/unscaledcycleclock.cc +@@ -20,7 +20,7 @@ + #include + #endif + +-#if defined(__powerpc__) || defined(__ppc__) ++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__) + #ifdef __GLIBC__ + #include + #elif defined(__FreeBSD__) +@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() { + return base_internal::NominalCPUFrequency(); + } + +-#elif defined(__powerpc__) || defined(__ppc__) ++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__) + + int64_t UnscaledCycleClock::Now() { + #ifdef __GLIBC__ +diff --git a/absl/base/internal/unscaledcycleclock_config.h b/absl/base/internal/unscaledcycleclock_config.h +index 43a3dabe..196a8535 100644 +--- a/absl/base/internal/unscaledcycleclock_config.h ++++ b/absl/base/internal/unscaledcycleclock_config.h +@@ -21,7 +21,8 @@ + + // The following platforms have an implementation of a hardware counter. + #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ +- defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) || \ ++ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \ ++ defined(_M_IX86) || \ + (defined(_M_X64) && !defined(_M_ARM64EC)) + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 + #else +diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc +index 3dd6ba1a..f923b055 100644 +--- a/absl/debugging/internal/examine_stack.cc ++++ b/absl/debugging/internal/examine_stack.cc +@@ -36,6 +36,10 @@ + #include + #include + ++#if defined(__powerpc__) ++#include ++#endif ++ + #include "absl/base/attributes.h" + #include "absl/base/internal/raw_logging.h" + #include "absl/base/macros.h" +@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) { + return reinterpret_cast(context->uc_mcontext.pc); + #elif defined(__powerpc64__) + return reinterpret_cast(context->uc_mcontext.gp_regs[32]); +-#elif defined(__powerpc__) ++#elif defined(__powerpc__) && defined(__GLIBC__) + return reinterpret_cast(context->uc_mcontext.uc_regs->gregs[32]); ++#elif defined(__powerpc__) ++ return reinterpret_cast((context->uc_regs)->gregs[32]); + #elif defined(__riscv) + return reinterpret_cast(context->uc_mcontext.__gregs[REG_PC]); + #elif defined(__s390__) && !defined(__s390x__) +diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h +index 3929b1b7..23d5e504 100644 +--- a/absl/debugging/internal/stacktrace_config.h ++++ b/absl/debugging/internal/stacktrace_config.h +@@ -60,7 +60,7 @@ + #elif defined(__i386__) || defined(__x86_64__) + #define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_x86-inl.inc" +-#elif defined(__ppc__) || defined(__PPC__) ++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__) + #define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_powerpc-inl.inc" + #elif defined(__aarch64__) +-- +2.25.1 + diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch new file mode 100644 index 00000000..9a4fc0b4 --- /dev/null +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch @@ -0,0 +1,30 @@ +From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001 +From: Derek Mauro +Date: Mon, 5 Aug 2024 07:35:05 -0700 +Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to + suppress warnings in headers". It should fall through to the "don't impose + our warnings on others" case. Do this by matching on "-Wno-*" instead of + "-Wno*". + +Fixes #1737 + +PiperOrigin-RevId: 659548798 +Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854 +Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5] +--- + CMake/AbseilHelpers.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake +index b177e590..3c4c92fe 100644 +--- a/CMake/AbseilHelpers.cmake ++++ b/CMake/AbseilHelpers.cmake +@@ -195,7 +195,7 @@ function(absl_cc_library) + # specified platform. Filter both of them out before the successor + # reaches the "^-m" filter. + set(skip_next_cflag ON) +- elseif(${cflag} MATCHES "^(-Wno|/wd)") ++ elseif(${cflag} MATCHES "^(-Wno-|/wd)") + # These flags are needed to suppress warnings that might fire in our headers. + set(PC_CFLAGS "${PC_CFLAGS} ${cflag}") + elseif(${cflag} MATCHES "^(-W|/w[1234eo])") diff --git a/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb new file mode 100644 index 00000000..4bfc2100 --- /dev/null +++ b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb @@ -0,0 +1,54 @@ +SUMMARY = "Abseil is a cpp library like STL" +DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \ +additional useful libraries like algorithm, container, debugging, hash, memory, \ +meta, numeric, strings, synchronization, time, types and utility." +HOMEPAGE = "https://abseil.io/" +SECTION = "libs" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915" + +SRCREV = "4447c7562e3bc702ade25105912dce503f0c4010" +BRANCH = "lts_2024_07_22" +SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \ + file://0001-absl-always-use-asm-sgidefs.h.patch \ + file://0002-Remove-maes-option-from-cross-compilation.patch \ + file://0003-Remove-neon-option-from-cross-compilation.patch \ + file://0004-abseil-ppc-fixes.patch \ + file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \ + " + +S = "${WORKDIR}/git" + +inherit cmake + +EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTING=OFF \ + -DABSL_ENABLE_INSTALL=ON \ + " + +SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}" + +PACKAGES_DYNAMIC += "^libabsl-*" +PACKAGES_DYNAMIC:class-native = "" + +PACKAGESPLITFUNCS =+ "split_dynamic_packages" + +python split_dynamic_packages() { + libdir = d.getVar('libdir') + + libpackages = do_split_packages( + d, + root=libdir, + file_regex=r'^libabsl_(.*)\.so\..*$', + output_pattern='libabsl-%s', + description="abseil shared library %s", + prepend=True, + extra_depends='', + ) + if libpackages: + d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(libpackages)) +} + +ALLOW_EMPTY:${PN} = "1" + +BBCLASSEXTEND = "native nativesdk" From patchwork Fri Jan 17 00:25:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 55694 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47514C0218C for ; Fri, 17 Jan 2025 00:25:25 +0000 (UTC) Received: from lelvem-ot02.ext.ti.com (lelvem-ot02.ext.ti.com [198.47.23.235]) by mx.groups.io with SMTP id smtpd.web11.603.1737073524703486258 for ; Thu, 16 Jan 2025 16:25:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EiqIltZJ; spf=pass (domain: ti.com, ip: 198.47.23.235, mailfrom: afd@ti.com) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelvem-ot02.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 50H0PNkN235683 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Jan 2025 18:25:23 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1737073523; bh=8TmuR1wgMOZex8h+96bH0/STiyCjoy1JuWRdy/bs1II=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=EiqIltZJCTDA5Tjk8AZq0WMRuKlsIKMhj1OSkcgTci5w1DasCIaHky2WKcmW4JSg4 7Q3953FWMk5monITt0rsTL4dcXcdyPdZUu6mu4puzvBcgEYkInSXMnfjMv4oRemFDH fxDxFTQizxRHztvGWeS+dudPXG5Sjqys0PeFjGTE= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTP id 50H0PN2q094674; Thu, 16 Jan 2025 18:25:23 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 16 Jan 2025 18:25:23 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 16 Jan 2025 18:25:23 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 50H0PLnu007059; Thu, 16 Jan 2025 18:25:23 -0600 From: Andrew Davis To: Denys Dmytriyenko , Ryan Eatmon , Chirag Shilwant , CC: Andrew Davis Subject: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX Date: Thu, 16 Jan 2025 18:25:19 -0600 Message-ID: <20250117002520.627504-6-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250117002520.627504-1-afd@ti.com> References: <20250117002520.627504-1-afd@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Jan 2025 00:25:25 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/15703 ONNX provides an open source format for AI models, both deep learning and traditional ML. It defines an extensible computation graph model, as well as definitions of built-in operators and standard data types. Signed-off-by: Andrew Davis --- ...age-Protobuf-before-checking-if-it-w.patch | 25 ++++ .../recipes-framework/onnx/onnx_1.16.1.bb | 107 ++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb diff --git a/meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch b/meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch new file mode 100644 index 00000000..dceac1f4 --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch @@ -0,0 +1,25 @@ +From 7e118775c120ec802d13ac3e0125d726323aee87 Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 16 Jan 2025 11:44:56 -0600 +Subject: [PATCH] Try to find package Protobuf before checking if it was found + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +--- + CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b666eec4..f6fbf159 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -127,6 +127,8 @@ if(ONNX_BUILD_TESTS) + set(googletest_STATIC_LIBRARIES GTest::gtest) + endif() + ++find_package(Protobuf) ++ + if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf)) + # Sometimes we need to use protoc compiled for host architecture while linking + # libprotobuf against target architecture. See https://github.com/caffe2/caffe diff --git a/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb b/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file mode 100644 index 00000000..9624d061 --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb @@ -0,0 +1,107 @@ +DESCRIPTION = "Open standard for machine learning interoperability" +SUMMARY = "ONNX Python package & C++ library" +HOMEPAGE = "https://www.onnx.ai/" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI = "git://github.com/onnx/onnx.git;protocol=https;branch=rel-1.16.1" +SRC_URI += "file://0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch" +SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad" + +S = "${WORKDIR}/git" + +DEPENDS += "\ + abseil-cpp \ + protobuf \ + protobuf-native \ + python3-protobuf \ + python3-protobuf-native \ +" + +PYTHON_DEPENDS = "\ + python3 \ + python3-numpy \ + python3-numpy-native \ + python3-pybind11 \ + python3-pybind11-native \ +" + +PYTHON_RDEPENDS = "\ + python3 \ + python3-numpy \ + python3-protobuf \ + python3-coloredlogs \ + python3-flatbuffers \ + python3-sympy \ +" + +PACKAGECONFIG ??= "python sharedlib unittests" + +PACKAGECONFIG[python] = "\ + -DBUILD_ONNX_PYTHON=ON \ + -DPYTHON_LIBRARY=${PYTHON_LIBRARY} \ + -DPYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIR}, \ + -DBUILD_ONNX_PYTHON=OFF, \ + ${PYTHON_DEPENDS} \ +" + +PACKAGECONFIG[sharedlib] = "-DBUILD_SHARED_LIBS=ON, -D-DBUILD_SHARED_LIBS=OFF" +PACKAGECONFIG[unittests] = "-DONNX_BUILD_TESTS=ON, -DONNX_BUILD_TESTS=OFF, googletest" + +EXTRA_OECMAKE:append = " \ + -DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \ + -DONNX_USE_PROTOBUF_SHARED_LIBS=ON \ + -DONNX_DISABLE_STATIC_REGISTRATION=ON \ + -DONNX_ML=1 \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + --log-level=VERBOSE \ +" + +inherit python3native cmake + +python do_build_version_file() { + import os + import textwrap + + version_file_path = os.path.join(d.getVar('B'), "onnx", "version.py") + os.makedirs(os.path.dirname(version_file_path), exist_ok=True) + with open(version_file_path, "w", encoding="utf-8") as f: + f.write( + textwrap.dedent( + f"""\ + # This file is generated. DO NOT EDIT! + + + version = "{d.getVar('PV')}" + git_version = "{d.getVar('SRCREV')}" + """ + ) + ) +} +addtask build_version_file before do_install after do_compile + +do_install:append() { + CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" + + # Install the Python package. + if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then + install -d ${D}${PYTHON_SITEPACKAGES_DIR}/onnx + (cd ${S}/onnx; cp --parents $(find . -name "*.py*") ${D}${PYTHON_SITEPACKAGES_DIR}/onnx) + cp $CP_ARGS ${B}/onnx ${D}${PYTHON_SITEPACKAGES_DIR} + cp $CP_ARGS ${B}/onnx_cpp2py_export.so ${D}${PYTHON_SITEPACKAGES_DIR}/onnx + fi +} + +# Add Python package +PACKAGE_BEFORE_PN += "${PYTHON_PN}-${PN}" +FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}" +RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx" + +# Output library is unversioned +SOLIBS = ".so" +FILES_SOLIBSDEV = "" + +# TODO: ONNXConfig.cmake in package onnx-dev contains reference to TMPDIR +INSANE_SKIP:${PN}-dev = "buildpaths" From patchwork Fri Jan 17 00:25:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 55696 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EC0DC02183 for ; Fri, 17 Jan 2025 00:25:35 +0000 (UTC) Received: from lelvem-ot01.ext.ti.com (lelvem-ot01.ext.ti.com [198.47.23.234]) by mx.groups.io with SMTP id smtpd.web11.604.1737073525085312002 for ; Thu, 16 Jan 2025 16:25:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=bQWe5pSr; spf=pass (domain: ti.com, ip: 198.47.23.234, mailfrom: afd@ti.com) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelvem-ot01.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 50H0PObK092111 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Jan 2025 18:25:24 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1737073524; bh=ECP9jsy3c4j/NyulS1ouo39yaNinE1PUCe48fCAUGHQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=bQWe5pSrHX2mQ9W9K3H4ngZwGB1Knq8rryCd1uc6xMwtwNHHJtCj2E2RcTDlgS8T2 umDuENMhtTgQYCnCUnrwJTAH0LK3onqlZIpKEjzQPXXmWvTEYR4F1sRzu4MxKiPSGk I9/qObyNy9MeFfly6z2rZpJKyE+9HwUOncjJsp18= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTP id 50H0POLB094678; Thu, 16 Jan 2025 18:25:24 -0600 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 16 Jan 2025 18:25:23 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 16 Jan 2025 18:25:23 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 50H0PLnv007059; Thu, 16 Jan 2025 18:25:23 -0600 From: Andrew Davis To: Denys Dmytriyenko , Ryan Eatmon , Chirag Shilwant , CC: Andrew Davis Subject: [meta-arago][scarthgap/master][PATCH 6/6] meta-arago-extras: Add recipe for ONNX Runtime Date: Thu, 16 Jan 2025 18:25:20 -0600 Message-ID: <20250117002520.627504-7-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250117002520.627504-1-afd@ti.com> References: <20250117002520.627504-1-afd@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Jan 2025 00:25:35 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/15704 ONNX Runtime is a cross-platform inference and training machine-learning accelerator. ONNX Runtime is compatible with different hardware, drivers, and operating systems, and provides optimal performance by leveraging hardware accelerators where applicable alongside graph optimizations and transforms. Signed-off-by: Andrew Davis --- ...ble-permission-bit-from-source-files.patch | 72 ++++++++ ...-in-option-text-s-buildings-bindings.patch | 25 +++ ...D_LIBRARY_PATH-to-search-path-when-n.patch | 32 ++++ ...MAKE_CXX_FLAGS-in-build-information-.patch | 31 ++++ ...ake-Print-out-result-of-find_package.patch | 37 +++++ .../onnxruntime/onnxruntime_1.20.1.bb | 155 ++++++++++++++++++ 6 files changed, 352 insertions(+) create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch new file mode 100644 index 00000000..c890f0bd --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch @@ -0,0 +1,72 @@ +From 626066499c34c524924302342fc071f32442caae Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Sun, 12 Jan 2025 12:48:49 -0600 +Subject: [PATCH] Remove executable permission bit from source files + +These are source files, not executables, do not set the executable +permission bit on these files. + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +--- + onnxruntime/contrib_ops/cpu/utils/console_dumper.h | 1 + + onnxruntime/core/optimizer/bias_softmax_fusion.cc | 0 + onnxruntime/core/providers/acl/acl_execution_provider.h | 0 + onnxruntime/core/providers/acl/acl_fwd.h | 0 + onnxruntime/core/providers/acl/acl_provider_factory.cc | 0 + onnxruntime/core/providers/acl/math/gemm.cc | 0 + onnxruntime/core/providers/acl/nn/batch_norm.cc | 0 + onnxruntime/core/providers/acl/nn/batch_norm.h | 0 + onnxruntime/test/optimizer/graph_transform_test.cc | 0 + onnxruntime/test/optimizer/graph_transform_test_layernorm.cc | 0 + 10 files changed, 1 insertion(+) + mode change 100755 => 100644 onnxruntime/core/optimizer/bias_softmax_fusion.cc + mode change 100755 => 100644 onnxruntime/core/providers/acl/acl_execution_provider.h + mode change 100755 => 100644 onnxruntime/core/providers/acl/acl_fwd.h + mode change 100755 => 100644 onnxruntime/core/providers/acl/acl_provider_factory.cc + mode change 100755 => 100644 onnxruntime/core/providers/acl/math/gemm.cc + mode change 100755 => 100644 onnxruntime/core/providers/acl/nn/batch_norm.cc + mode change 100755 => 100644 onnxruntime/core/providers/acl/nn/batch_norm.h + mode change 100755 => 100644 onnxruntime/test/optimizer/graph_transform_test.cc + mode change 100755 => 100644 onnxruntime/test/optimizer/graph_transform_test_layernorm.cc + +diff --git a/onnxruntime/contrib_ops/cpu/utils/console_dumper.h b/onnxruntime/contrib_ops/cpu/utils/console_dumper.h +index 9ebc44f441..64bd2b7b18 100644 +--- a/onnxruntime/contrib_ops/cpu/utils/console_dumper.h ++++ b/onnxruntime/contrib_ops/cpu/utils/console_dumper.h +@@ -3,6 +3,7 @@ + + #pragma once + #include ++#include + #include "core/framework/ort_value.h" + #include "core/framework/float16.h" + #include "contrib_ops/cpu/utils/debug_macros.h" +diff --git a/onnxruntime/core/optimizer/bias_softmax_fusion.cc b/onnxruntime/core/optimizer/bias_softmax_fusion.cc +old mode 100755 +new mode 100644 +diff --git a/onnxruntime/core/providers/acl/acl_execution_provider.h b/onnxruntime/core/providers/acl/acl_execution_provider.h +old mode 100755 +new mode 100644 +diff --git a/onnxruntime/core/providers/acl/acl_fwd.h b/onnxruntime/core/providers/acl/acl_fwd.h +old mode 100755 +new mode 100644 +diff --git a/onnxruntime/core/providers/acl/acl_provider_factory.cc b/onnxruntime/core/providers/acl/acl_provider_factory.cc +old mode 100755 +new mode 100644 +diff --git a/onnxruntime/core/providers/acl/math/gemm.cc b/onnxruntime/core/providers/acl/math/gemm.cc +old mode 100755 +new mode 100644 +diff --git a/onnxruntime/core/providers/acl/nn/batch_norm.cc b/onnxruntime/core/providers/acl/nn/batch_norm.cc +old mode 100755 +new mode 100644 +diff --git a/onnxruntime/core/providers/acl/nn/batch_norm.h b/onnxruntime/core/providers/acl/nn/batch_norm.h +old mode 100755 +new mode 100644 +diff --git a/onnxruntime/test/optimizer/graph_transform_test.cc b/onnxruntime/test/optimizer/graph_transform_test.cc +old mode 100755 +new mode 100644 +diff --git a/onnxruntime/test/optimizer/graph_transform_test_layernorm.cc b/onnxruntime/test/optimizer/graph_transform_test_layernorm.cc +old mode 100755 +new mode 100644 diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch new file mode 100644 index 00000000..88423190 --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch @@ -0,0 +1,25 @@ +From be67663e9a44d146033aeb97804145a60b4032db Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 16 Jan 2025 12:35:03 -0600 +Subject: [PATCH] [cmake] Fix typo in option text s/buildings/bindings + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +--- + cmake/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index d90a2a3550..e0cde678db 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -77,7 +77,7 @@ option(onnxruntime_GENERATE_TEST_REPORTS "Enable test report generation" OFF) + option(onnxruntime_ENABLE_STATIC_ANALYSIS "Enable static analysis" OFF) + option(onnxruntime_USE_CUSTOM_STATIC_ANALYSIS_RULES "Use a custom SDL Rule. It is mainly for our CI build" OFF) + option(onnxruntime_REDIRECT_STATIC_ANALYSIS_OUTPUTS_TO_FILE "Use a custom SDL Rule. It is mainly for our CI build" OFF) +-option(onnxruntime_ENABLE_PYTHON "Enable python buildings" OFF) ++option(onnxruntime_ENABLE_PYTHON "Enable python bindings" OFF) + # Enable it may cause LNK1169 error + option(onnxruntime_ENABLE_MEMLEAK_CHECKER "Experimental: Enable memory leak checker in Windows debug build" OFF) + option(onnxruntime_USE_CUDA "Build with CUDA support" OFF) diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch new file mode 100644 index 00000000..cd979b76 --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch @@ -0,0 +1,32 @@ +From b1689f3f963f4c07d3329a838569ac4c2fa2bd5f Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 16 Jan 2025 12:38:13 -0600 +Subject: [PATCH] [ACL] Do not add LD_LIBRARY_PATH to search path when not + defined + +If LD_LIBRARY_PATH is not defined a blank "-L" is added to the +link command. This causes the next object to be linked to get +treated as if it was a search path and causes link failure. + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +--- + cmake/onnxruntime_providers_acl.cmake | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/cmake/onnxruntime_providers_acl.cmake b/cmake/onnxruntime_providers_acl.cmake +index e23d289271..19d41dc73f 100644 +--- a/cmake/onnxruntime_providers_acl.cmake ++++ b/cmake/onnxruntime_providers_acl.cmake +@@ -13,7 +13,9 @@ + onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11 safeint_interface + ) + +- target_link_libraries(onnxruntime_providers_acl -L$ENV{LD_LIBRARY_PATH}) ++ if (DEFINED ENV{LD_LIBRARY_PATH}) ++ target_link_libraries(onnxruntime_providers_acl -L$ENV{LD_LIBRARY_PATH}) ++ endif() + add_dependencies(onnxruntime_providers_acl ${onnxruntime_EXTERNAL_DEPENDENCIES}) + set_target_properties(onnxruntime_providers_acl PROPERTIES FOLDER "ONNXRuntime") + target_include_directories(onnxruntime_providers_acl diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch new file mode 100644 index 00000000..46fc2fc5 --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch @@ -0,0 +1,31 @@ +From 7ea6e35d3630f8c19080a0cb5a4a4c55c242a36b Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 16 Jan 2025 12:40:57 -0600 +Subject: [PATCH] Do not include CMAKE_CXX_FLAGS in build information string + +While this information can be useful, it often includes information +that may be specific to the build machine (like include paths with +usernames, e.g. -I /home/myname/externalproject/fakeroot/inlcude). + +This causes issues for reproducible builds (resulting binaries will +be different between different build machines). + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +--- + cmake/CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index e0cde678db..e0d8fd0a17 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -1439,7 +1439,6 @@ if (Git_FOUND) + string(APPEND ORT_BUILD_INFO "git-branch=${ORT_GIT_BRANCH}, git-commit-id=${ORT_GIT_COMMIT}, ") + endif() + string(APPEND ORT_BUILD_INFO "build type=${CMAKE_BUILD_TYPE}") +-string(APPEND ORT_BUILD_INFO ", cmake cxx flags: ${CMAKE_CXX_FLAGS}") + configure_file(onnxruntime_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/onnxruntime_config.h) + get_property(onnxruntime_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch new file mode 100644 index 00000000..9bbe920b --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch @@ -0,0 +1,37 @@ +From a73d9b9f4dba6d164e128d6c768d1b0a04e969ab Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 16 Jan 2025 12:47:27 -0600 +Subject: [PATCH] [cmake] Print out result of find_package + +A verbose only message is already printed that states the CMake will +attempt to find a package using find_package(): + +> Trying find_package(...) before FetchContent + +But it never prints if the package was found this way or not. +Add this result message. + +Upstream-Status: Pending + +Signed-off-by: Andrew Davis +--- + cmake/external/helper_functions.cmake | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/cmake/external/helper_functions.cmake b/cmake/external/helper_functions.cmake +index e3f2211f96..9ca6a967da 100644 +--- a/cmake/external/helper_functions.cmake ++++ b/cmake/external/helper_functions.cmake +@@ -138,9 +138,12 @@ macro(onnxruntime_fetchcontent_makeavailable) + unset(__cmake_fpArgs) + + if(${__cmake_contentName}_FOUND) ++ message(VERBOSE "Found ${__cmake_contentName} with find_package()") + FetchContent_SetPopulated(${__cmake_contentName}) + FetchContent_GetProperties(${__cmake_contentName}) + continue() ++ else() ++ message(VERBOSE "Could not find ${__cmake_contentName} with find_package()") + endif() + endif() + else() diff --git a/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb new file mode 100644 index 00000000..84a02d56 --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb @@ -0,0 +1,155 @@ +DESCRIPTION = "ONNX Runtime is a cross-platform, high performance machine learning inferencing framework" +SUMMARY = "ONNX Runtime Python package & C++ library" +HOMEPAGE = "https://www.onnxruntime.ai/" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=0f7e3b1308cb5c00b372a6e78835732d" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI = "\ + git://github.com/microsoft/onnxruntime.git;protocol=https;branch=rel-1.20.1 \ + git://github.com/HowardHinnant/date.git;protocol=https;branch=master;name=date;destsuffix=${S}/cmake/external/date \ + git://github.com/pytorch/cpuinfo.git;protocol=https;branch=main;name=cpuinfo;destsuffix=${S}/cmake/external/cpuinfo \ + git://github.com/google/flatbuffers.git;protocol=https;branch=master;name=flatbuffers;destsuffix=${S}/cmake/external/flatbuffers \ + git://github.com/dcleblanc/SafeInt.git;protocol=https;branch=master;name=safeint;destsuffix=${S}/cmake/external/safeint \ + git://gitlab.com/libeigen/eigen.git;protocol=https;branch=3.4;name=eigen;destsuffix=${S}/cmake/external/eigen \ + git://github.com/google/nsync.git;protocol=https;branch=master;name=nsync;destsuffix=${S}/cmake/external/nsync \ +" +SRC_URI += "\ + file://0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch \ + file://0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch \ + file://0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch \ + file://0005-cmake-Print-out-result-of-find_package.patch \ + file://0001-Remove-executable-permission-bit-from-source-files.patch \ +" + +SRCREV_FORMAT = "default" +SRCREV = "5c1b7ccbff7e5141c1da7a9d963d660e5741c319" +SRCREV_date = "6e921e1b1d21e84a5c82416ba7ecd98e33a436d0" +SRCREV_cpuinfo = "ca678952a9a8eaa6de112d154e8e104b22f9ab3f" +SRCREV_flatbuffers = "0100f6a5779831fa7a651e4b67ef389a8752bd9b" +SRCREV_safeint = "4cafc9196c4da9c817992b20f5253ef967685bf8" +SRCREV_eigen = "e7248b26a1ed53fa030c5c459f7ea095dfd276ac" +SRCREV_nsync = "13de152c2a1cd73ff4df97bd2c406b6d15d34af3" + +S = "${WORKDIR}/git" + +DEPENDS += "\ + onnx \ + abseil-cpp \ + protobuf \ + protobuf-native \ + boost \ + re2 \ + nlohmann-json \ + microsoft-gsl \ +" + +PYTHON_DEPENDS = "\ + python3 \ + python3-numpy \ + python3-numpy-native \ + python3-pybind11 \ + python3-pybind11-native \ +" + +PYTHON_RDEPENDS = "\ + python3 \ + python3-onnx \ + python3-numpy \ + python3-protobuf \ + python3-coloredlogs \ + python3-flatbuffers \ + python3-sympy \ +" + +OECMAKE_SOURCEPATH = "${S}/cmake" + +PACKAGECONFIG ??= "python sharedlib unittests acl" + +PACKAGECONFIG[python] = "-Donnxruntime_ENABLE_PYTHON=ON, -Donnxruntime_ENABLE_PYTHON=OFF, ${PYTHON_DEPENDS}" +PACKAGECONFIG[sharedlib] = "-Donnxruntime_BUILD_SHARED_LIB=ON, -Donnxruntime_BUILD_SHARED_LIB=OFF" +PACKAGECONFIG[unittests] = "-Donnxruntime_BUILD_UNIT_TESTS=ON, -Donnxruntime_BUILD_UNIT_TESTS=OFF, googletest" + +PACKAGECONFIG[acl] = "-Donnxruntime_USE_ACL=ON, -Donnxruntime_USE_ACL=OFF, arm-compute-library" +PACKAGECONFIG[armnn] = "-Donnxruntime_USE_ARMNN=ON, -Donnxruntime_USE_ARMNN=OFF, armnn" +PACKAGECONFIG[armnn-relu] = "-Donnxruntime_ARMNN_RELU_USE_CPU=ON, -Donnxruntime_ARMNN_RELU_USE_CPU=OFF" +PACKAGECONFIG[armnn-bn] = "-Donnxruntime_ARMNN_BN_USE_CPU=ON, -Donnxruntime_ARMNN_BN_USE_CPU=OFF" + +EXTRA_OECMAKE:append = " \ + -DFETCHCONTENT_FULLY_DISCONNECTED=ON \ + -DFETCHCONTENT_SOURCE_DIR_DATE=${S}/cmake/external/date \ + -DFETCHCONTENT_SOURCE_DIR_PYTORCH_CPUINFO=${S}/cmake/external/cpuinfo \ + -DFETCHCONTENT_SOURCE_DIR_PYTORCH_CLOG=${S}/cmake/external/cpuinfo \ + -DFETCHCONTENT_SOURCE_DIR_FLATBUFFERS=${S}/cmake/external/flatbuffers \ + -DFETCHCONTENT_SOURCE_DIR_SAFEINT=${S}/cmake/external/safeint \ + -DFETCHCONTENT_SOURCE_DIR_EIGEN=${S}/cmake/external/eigen \ + -DFETCHCONTENT_SOURCE_DIR_GOOGLE_NSYNC=${S}/cmake/external/nsync \ +" + +EXTRA_OECMAKE:append = " \ + -DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \ + -Donnx_SOURCE_DIR=${RECIPE_SYSROOT}${PYTHON_SITEPACKAGES_DIR} \ + -DPython_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ + --compile-no-warning-as-error \ + --log-level=VERBOSE \ +" + +inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} +inherit python3-dir cmake + +do_install:append() { + CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" + + # Install test binaries and data in test package + install -d ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/libcustom_op_library.so ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/libcustom_op_get_const_input_test_library.so ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/libcustom_op_local_function.so ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/libcustom_op_invalid_library.so ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/libtest_execution_provider.so ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/onnxruntime_customopregistration_test ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/onnxruntime_global_thread_pools_test ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/onnxruntime_logging_apis_test ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/onnxruntime_mlas_test ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/onnxruntime_perf_test ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/onnxruntime_shared_lib_test ${D}${bindir}/${BPN}-tests + install -m 0755 ${B}/onnxruntime_test_all ${D}${bindir}/${BPN}-tests + cp $CP_ARGS ${B}/testdata ${D}${bindir}/${BPN}-tests + + # Install python tests and data + cp $CP_ARGS ${S}/onnxruntime/test/python/* ${D}${bindir}/${BPN}-tests + + # Install the Python package. + if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then + install -d ${D}${PYTHON_SITEPACKAGES_DIR} + cp $CP_ARGS ${B}/onnxruntime ${D}${PYTHON_SITEPACKAGES_DIR} + find ${D}${PYTHON_SITEPACKAGES_DIR} -name "libonnx*.so*" -exec rm {} \; + fi +} + +# Add Python package +PACKAGE_BEFORE_PN += "${PYTHON_PN}-${PN}" +FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}" +RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnxruntime" + +# Add Python tests package +PACKAGE_BEFORE_PN += "${PYTHON_PN}-${PN}-tests" +FILES:${PYTHON_PN}-${PN}-tests += "\ + ${bindir}/${BPN}-tests/*.py \ + ${bindir}/${BPN}-tests/contrib_ops \ + ${bindir}/${BPN}-tests/quantization \ + ${bindir}/${BPN}-tests/transformers \ +" +RDEPENDS:${PYTHON_PN}-${PN}-tests += "${PYTHON_PN}-${PN}" + +# Add tests package +PACKAGE_BEFORE_PN += "${PN}-tests" +FILES:${PN}-tests = "${bindir}/${BPN}-tests" +INSANE_SKIP:${PN}-tests += "libdir" + +# package unversioned .so files in PN (they are not dev symlinks) +FILES_SOLIBSDEV = "${libdir}/libonnxruntime.so" +FILES:${PN} += "${libdir}/libonnxruntime_providers_shared.so" + +INSANE_SKIP:${PN}-dbg += "libdir"