diff options
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rwxr-xr-x | build-tool/scripts/build-armnn.sh | 60 | ||||
-rwxr-xr-x | build-tool/scripts/common.sh | 15 | ||||
-rwxr-xr-x | build-tool/scripts/install-packages.sh | 21 | ||||
-rwxr-xr-x | build-tool/scripts/setup-armnn.sh | 44 | ||||
-rwxr-xr-x | build-tool/scripts/validation.sh | 6 | ||||
-rw-r--r-- | profiling/server/src/basePipeServer/tests/BasePipeServerTests.cpp | 6 | ||||
-rw-r--r-- | src/armnn/Utils.cpp | 6 | ||||
-rw-r--r-- | src/armnn/test/RuntimeTests.cpp | 6 | ||||
-rw-r--r-- | src/backends/backendsCommon/test/BackendProfilingTests.cpp | 11 | ||||
-rw-r--r-- | src/backends/backendsCommon/test/DynamicBackendTests.cpp | 6 | ||||
-rw-r--r-- | src/backends/neon/test/NeonCreateWorkloadTests.cpp | 34 | ||||
-rw-r--r-- | src/backends/neon/test/NeonLayerTests.cpp | 4 | ||||
-rw-r--r-- | src/backends/neon/test/NeonRuntimeTests.cpp | 8 | ||||
-rw-r--r-- | src/profiling/test/ProfilingTests.cpp | 7 | ||||
-rw-r--r-- | src/profiling/test/SendTimelinePacketTests.cpp | 7 | ||||
-rw-r--r-- | src/timelineDecoder/tests/JSONTimelineDecoderTests.cpp | 9 | ||||
-rw-r--r-- | tests/profiling/gatordmock/tests/GatordMockTests.cpp | 6 |
18 files changed, 218 insertions, 50 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 29a72e36eb..e8067350ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved. +# Copyright © 2017-2024 Arm Ltd and Contributors. All rights reserved. # Copyright © 2020 NXP # SPDX-License-Identifier: MIT # @@ -476,10 +476,12 @@ endif() target_compile_definitions(armnn PRIVATE "ARMNN_COMPILING_DLL") -# Generate a map file for all build modes -set_property(TARGET armnn APPEND_STRING PROPERTY - LINK_FLAGS " -Wl,-Map=libarmnnMapFile.map") -message(STATUS "Linker will generate mapfile ") +# Generate a map file for Linux build modes +if (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Darwin)) + set_property(TARGET armnn APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-Map=libarmnnMapFile.map") + message(STATUS "Linker will generate mapfile ") +endif() target_include_directories(armnn PUBLIC diff --git a/build-tool/scripts/build-armnn.sh b/build-tool/scripts/build-armnn.sh index 18e59e1cb5..5bc8d697ff 100755 --- a/build-tool/scripts/build-armnn.sh +++ b/build-tool/scripts/build-armnn.sh @@ -17,12 +17,36 @@ abs_script_path=$(cd "$rel_path" ; pwd -P) # absolute path to script directory abs_btool_path=$(dirname "$abs_script_path") # absolute path to build-tool directory abs_armnn_path=$(dirname "$abs_btool_path") # absolute path to armnn directory +# Figure out platform specific settings +osname=$(uname) +osgetopt=getopt +os_darwin=0 +if [ "$osname" == "Darwin" ]; then + os_darwin=1 + osgetoptsys="/opt/homebrew/opt/gnu-getopt/bin/getopt" + osgetopthome="$HOME/homebrew/opt/gnu-getopt/bin/getopt" + if [ -f "$osgetoptsys" ]; then + echo "gnu-getopt found at: $osgetoptsys" + osgetopt=$osgetoptsys + elif [ -f "$osgetopthome" ]; then + echo "gnu-getopt found at: $osgetopthome" + osgetopt=$osgetopthome + else + echo "Run $rel_path/install-packages.sh and follow the instructions to configure the environment for $osname" + exit 1 + fi +fi + build_acl() { cd "$ACL_SRC" # $acl_scons_params are additional options provided by the user and will overwrite any previously defined args - local acl_params="neon=$flag_neon_backend opencl=$flag_cl_backend Werror=0 embed_kernels=1 examples=0 validation_tests=0 benchmark_tests=0 benchmark_examples=0 $acl_scons_params" + acl_extra="" + if [ "$os_darwin" -eq 1 ]; then + acl_extra="os=macos " + fi + local acl_params="$acl_extra neon=$flag_neon_backend opencl=$flag_cl_backend Werror=0 embed_kernels=1 examples=0 validation_tests=0 benchmark_tests=0 benchmark_examples=0 $acl_scons_params" if [ "$flag_debug" -eq 1 ]; then acl_params="$acl_params debug=1 asserts=1" @@ -100,10 +124,16 @@ build_armnn() local cmake_flags="" local compile_flags="" local android_cmake_args="" + local linker_cmake_args="" + local warn_flags="" case "$TARGET_ARCH" in "aarch64") compile_flags+="$AARCH64_COMPILER_FLAGS" + if [ "$os_darwin" -eq 1 ]; then + linker_cmake_args="-DCMAKE_SHARED_LINKER_FLAGS='-framework CoreFoundation -framework Foundation'" + warn_flags="-DCMAKE_CXX_FLAGS='-Wno-error=deprecated-declarations'" + fi ;; "android64") compile_flags+="$ANDROID64_COMPILER_FLAGS" @@ -125,8 +155,17 @@ build_armnn() echo -e "\n***** Building Arm NN for $TARGET_ARCH *****" + local flatbuffers_root="$FLATBUFFERS_BUILD_TARGET" + local protobuf_root="$PROTOBUF_BUILD_TARGET" + if [ "$os_darwin" -eq 1 ]; then + flatbuffers_root="$FLATBUFFERS_BUILD_HOST" + protobuf_root="$PROTOBUF_BUILD_HOST" + fi + eval "$compile_flags" \ cmake "$android_cmake_args" \ + "$linker_cmake_args" \ + "$warn_flags" \ -DCMAKE_BUILD_TYPE="$build_type" \ -DBUILD_CLASSIC_DELEGATE="$flag_tflite_classic_delegate" \ -DBUILD_OPAQUE_DELEGATE="$flag_tflite_opaque_delegate" \ @@ -143,17 +182,21 @@ build_armnn() -DTF_LITE_GENERATED_PATH="$TFLITE_SRC"/schema \ -DTF_LITE_SCHEMA_INCLUDE_PATH="$TFLITE_SRC"/schema \ -DTFLITE_LIB_ROOT="$TFLITE_BUILD_TARGET" \ - -DFLATBUFFERS_ROOT="$FLATBUFFERS_BUILD_TARGET" \ + -DFLATBUFFERS_ROOT="$flatbuffers_root" \ -DFLATC_DIR="$FLATBUFFERS_BUILD_HOST" \ -DONNX_GENERATED_SOURCES="$ONNX_BUILD_TARGET" \ - -DPROTOBUF_ROOT="$PROTOBUF_BUILD_TARGET" \ + -DPROTOBUF_ROOT="$protobuf_root" \ "$armnn_cmake_args" \ "$ARMNN_SRC" make -j "$NUM_THREADS" # Copy protobuf library into Arm NN build directory, if ONNX Parser is enabled - if [ "$flag_onnx_parser" -eq 1 ]; then + if [ "$flag_onnx_parser" -eq 1 ] && [ "$os_darwin" -eq 1 ]; then + cd "$ARMNN_BUILD_TARGET" + rm -f libprotobuf.dylib libprotobuf.23.dylib + cp "$PROTOBUF_LIBRARY_TARGET" . + elif [ "$flag_onnx_parser" -eq 1 ]; then cd "$ARMNN_BUILD_TARGET" rm -f libprotobuf.so libprotobuf.so.23 libprotobuf.so.23.0.0 if [ "$TARGET_ARCH" != "android64" ]; then @@ -228,7 +271,12 @@ download_acl() acl_tag="$(echo "$armnn_branch" | tr '\n' ' ' | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /./g')" cd "$ACL_SRC" - git checkout v"$acl_tag" + if [ "$acl_tag" == "" ]; then + # Take the latest + git checkout main + else + git checkout v"$acl_tag" + fi echo -e "\n***** ACL Downloaded: $acl_tag *****" } @@ -324,7 +372,7 @@ if [ $# -eq 0 ]; then exit 1 fi -args=$(getopt -ohx -l tflite-classic-delegate,tflite-opaque-delegate,tflite-parser,onnx-parser,all,target-arch:,neon-backend,cl-backend,ref-backend,clean,debug,armnn-cmake-args:,acl-scons-params:,num-threads:,symlink-armnn,help -n "$name" -- "$@") +args=$($osgetopt -ohx -l tflite-classic-delegate,tflite-opaque-delegate,tflite-parser,onnx-parser,all,target-arch:,neon-backend,cl-backend,ref-backend,clean,debug,armnn-cmake-args:,acl-scons-params:,num-threads:,symlink-armnn,help -n "$name" -- "$@") eval set -- "$args" while [ $# -gt 0 ]; do if [ -n "${opt_prev:-}" ]; then diff --git a/build-tool/scripts/common.sh b/build-tool/scripts/common.sh index e68de99c9d..0c34c7e7df 100755 --- a/build-tool/scripts/common.sh +++ b/build-tool/scripts/common.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. +# Copyright © 2022-2024 Arm Ltd and Contributors. All rights reserved. # SPDX-License-Identifier: MIT # @@ -34,9 +34,16 @@ TARGET_ARCH="$target_arch" NATIVE_BUILD=0 if [ "$TARGET_ARCH" == "$HOST_ARCH" ]; then NATIVE_BUILD=1 +elif [ "$TARGET_ARCH" == "aarch64" ]; then + if [ "$HOST_ARCH" == "arm64" ]; then + NATIVE_BUILD=1 + fi fi AARCH64_COMPILER_FLAGS+="CC=/usr/bin/aarch64-linux-gnu-gcc CXX=/usr/bin/aarch64-linux-gnu-g++ " +if [ "$HOST_ARCH" == "arm64" ]; then + AARCH64_COMPILER_FLAGS+="CC=/usr/bin/clang CXX=/usr/bin/clang++ " +fi # NDK NDK_VERSION=26b @@ -74,7 +81,11 @@ PROTOBUF_BUILD_ROOT="$BUILD_DIR"/protobuf PROTOBUF_BUILD_HOST="$PROTOBUF_BUILD_ROOT"/"$HOST_ARCH"_build PROTOCOL_COMPILER_HOST="$PROTOBUF_BUILD_HOST"/bin/protoc PROTOBUF_BUILD_TARGET="$PROTOBUF_BUILD_ROOT"/"$TARGET_ARCH"_build -PROTOBUF_LIBRARY_TARGET="$PROTOBUF_BUILD_TARGET"/lib/libprotobuf.so.23.0.0 +if [ "$osname" == "Darwin" ]; then + PROTOBUF_LIBRARY_TARGET="$PROTOBUF_BUILD_HOST"/lib/libprotobuf.dylib +else + PROTOBUF_LIBRARY_TARGET="$PROTOBUF_BUILD_TARGET"/lib/libprotobuf.so.23.0.0 +fi PROTOBUF_ANDROID_LIB_TARGET="$PROTOBUF_BUILD_TARGET"/lib/libprotobuf.so # ONNX diff --git a/build-tool/scripts/install-packages.sh b/build-tool/scripts/install-packages.sh index 1a238b6c98..4a461a0d55 100755 --- a/build-tool/scripts/install-packages.sh +++ b/build-tool/scripts/install-packages.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +# Copyright © 2022, 2024 Arm Ltd and Contributors. All rights reserved. # SPDX-License-Identifier: MIT # @@ -91,6 +91,25 @@ install_apt_packages() rm -rf /var/lib/apt/lists/* } +usage_darwin() +{ + cat <<EOF +The $osname platform requires manual setup: +0) Install the command line developer tools (at a minimum) +1) Install homebrew and then run the following in a terminal: + 1) brew install cmake + 2) brew install scons + 3) brew install gnu-getopt + 4) brew install wget +EOF +} + +osname=$(uname) +if [ "$osname" == "Darwin" ]; then + usage_darwin + exit 1 +fi + name=$(basename "$0") if [ ! "$(id -u)" -eq 0 ]; then diff --git a/build-tool/scripts/setup-armnn.sh b/build-tool/scripts/setup-armnn.sh index 6b87d6f6ea..a4453560ec 100755 --- a/build-tool/scripts/setup-armnn.sh +++ b/build-tool/scripts/setup-armnn.sh @@ -13,6 +13,26 @@ set -o errexit # Catch and propagate non zero exit codes. rel_path=$(dirname "$0") # relative path from where script is executed to script location +# Figure out platform specific settings +osname=$(uname) +osgetopt=getopt +os_darwin=0 +if [ "$osname" == "Darwin" ]; then + os_darwin=1 + osgetoptsys="/opt/homebrew/opt/gnu-getopt/bin/getopt" + osgetopthome="$HOME/homebrew/opt/gnu-getopt/bin/getopt" + if [ -f "$osgetoptsys" ]; then + echo "gnu-getopt found at: $osgetoptsys" + osgetopt=$osgetoptsys + elif [ -f "$osgetopthome" ]; then + echo "gnu-getopt found at: $osgetopthome" + osgetopt=$osgetopthome + else + echo "Run $rel_path/install-packages.sh and follow the instructions to configure the environment for $osname" + exit 1 + fi +fi + # Download an archive using wget and extract using tar # Takes three arguments: # 1. Name of dependency being downloaded e.g. Flatbuffers @@ -138,6 +158,9 @@ build_flatbuffers() target_arch="$HOST_ARCH" mkdir -p "$FLATBUFFERS_BUILD_HOST" build_dir="$FLATBUFFERS_BUILD_HOST" + if [ "$os_darwin" -eq 1 ]; then + cmake_flags+="$AARCH64_COMPILER_FLAGS" + fi fi echo -e "\n***** Building flatbuffers for $target_arch *****" @@ -184,6 +207,14 @@ download_tensorflow() echo -e "\n***** TensorFlow downloaded *****" } +build_tflite_cpuinfo() +{ + cd "$TFLITE_BUILD_TARGET"/cpuinfo + cmake . + make + cp *.a ../_deps/cpuinfo-build +} + build_tflite() { mkdir -p "$TFLITE_BUILD_TARGET" @@ -194,9 +225,13 @@ build_tflite() case "$TARGET_ARCH" in "aarch64") + cmake_system="Linux" + if [ "$os_darwin" -eq 1 ]; then + cmake_system="Darwin" + fi cmake_flags+="$AARCH64_COMPILER_FLAGS" target_arch_cmd="-DCMAKE_SYSTEM_PROCESSOR=aarch64 \ - -DCMAKE_SYSTEM_NAME=Linux " + -DCMAKE_SYSTEM_NAME=$cmake_system " if [ "$NATIVE_BUILD" -eq 0 ]; then cmake_flags+="ARMCC_FLAGS='-funsafe-math-optimizations' " @@ -226,6 +261,11 @@ build_tflite() "$TFLITE_SRC" cmake --build . -j "$NUM_THREADS" + if [ "$os_darwin" -eq 1 ]; then + # Workaround undefined link error for this platform + build_tflite_cpuinfo + fi + echo -e "\n***** Built TF Lite for $TARGET_ARCH *****" } @@ -324,7 +364,7 @@ if [ $# -eq 0 ]; then exit 1 fi -args=$(getopt -ohx -l tflite-classic-delegate,tflite-opaque-delegate,tflite-parser,onnx-parser,all,target-arch:,num-threads:,help -n "$name" -- "$@") +args=$($osgetopt -ohx -l tflite-classic-delegate,tflite-opaque-delegate,tflite-parser,onnx-parser,all,target-arch:,num-threads:,help -n "$name" -- "$@") eval set -- "$args" while [ $# -gt 0 ]; do if [ -n "${opt_prev:-}" ]; then diff --git a/build-tool/scripts/validation.sh b/build-tool/scripts/validation.sh index 1d7af76e2a..a18908ebfb 100755 --- a/build-tool/scripts/validation.sh +++ b/build-tool/scripts/validation.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. +# Copyright © 2022-2024 Arm Ltd and Contributors. All rights reserved. # SPDX-License-Identifier: MIT # @@ -16,12 +16,12 @@ set -o errexit # Catch and propagate non zero exit codes. # Host and target architecture validation if [ "$target_arch" == "" ]; then - echo "$name: --target-arch is not set. Example usage: --target-arch=aarch64" + echo "$name: --target_arch is not set. Example usage: --target_arch=aarch64" exit 1 fi if [ "$target_arch" != "aarch64" ] && [ "$target_arch" != "android64" ] && [ "$target_arch" != "x86_64" ]; then - echo "$name: --target-arch is not valid. Valid options are: aarch64, android64, x86_64" + echo "$name: --target_arch is not valid. Valid options are: aarch64, android64, x86_64" exit 1 fi diff --git a/profiling/server/src/basePipeServer/tests/BasePipeServerTests.cpp b/profiling/server/src/basePipeServer/tests/BasePipeServerTests.cpp index 8374102033..7b66ccc012 100644 --- a/profiling/server/src/basePipeServer/tests/BasePipeServerTests.cpp +++ b/profiling/server/src/basePipeServer/tests/BasePipeServerTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -17,6 +17,8 @@ TEST_SUITE("BasePipeServerTests") { using namespace arm::pipe; +#if !defined(__APPLE__) + TEST_CASE("BasePipeServerTest") { // Setup the mock service to bind to the UDS. @@ -96,4 +98,6 @@ TEST_CASE("BasePipeServerTest") socketProfilingConnection.Close(); } +#endif + } diff --git a/src/armnn/Utils.cpp b/src/armnn/Utils.cpp index 33d654f484..38732b3530 100644 --- a/src/armnn/Utils.cpp +++ b/src/armnn/Utils.cpp @@ -1,17 +1,19 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017, 2024 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // #include "armnn/Logging.hpp" #include "armnn/Utils.hpp" #include "armnn/Version.hpp" +#if !defined(__APPLE__) #if !defined(ARMNN_BUILD_BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) #include <sys/auxv.h> #include <asm/hwcap.h> #endif +#endif namespace armnn { @@ -36,6 +38,7 @@ static DefaultLoggingConfiguration g_DefaultLoggingConfiguration; // Detect the presence of Neon on Linux bool NeonDetected() { +#if !defined(__APPLE__) #if !defined(ARMNN_BUILD_BARE_METAL) && (defined(__arm__) || defined(__aarch64__)) auto hwcaps= getauxval(AT_HWCAP); #endif @@ -68,6 +71,7 @@ bool NeonDetected() } #endif +#endif // This method of Neon detection is only supported on Linux so in order to prevent a false negative // we will return true in cases where detection did not run. diff --git a/src/armnn/test/RuntimeTests.cpp b/src/armnn/test/RuntimeTests.cpp index 41a3fe1b64..7079f0e4e8 100644 --- a/src/armnn/test/RuntimeTests.cpp +++ b/src/armnn/test/RuntimeTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2017-2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -649,6 +649,8 @@ TEST_CASE("ProfilingDisable") CHECK(!readableBuffer); } +#if !defined(__APPLE__) + TEST_CASE("ProfilingEnableCpuRef") { using namespace armnn; @@ -1299,6 +1301,8 @@ TEST_CASE("ProfilingPostOptimisationStructureCpuRef") VerifyPostOptimisationStructureTestImpl(armnn::Compute::CpuRef); } +#endif + TEST_CASE("RuntimeOptimizeImportOff_LoadNetworkImportOn") { // In this test case we'll optimize a network with both import and export disabled. Then we'll attempt to load diff --git a/src/backends/backendsCommon/test/BackendProfilingTests.cpp b/src/backends/backendsCommon/test/BackendProfilingTests.cpp index 439eff0a79..5b9c5e89f1 100644 --- a/src/backends/backendsCommon/test/BackendProfilingTests.cpp +++ b/src/backends/backendsCommon/test/BackendProfilingTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023-2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -155,6 +155,9 @@ arm::pipe::Packet PacketWriter(uint32_t period, std::vector<uint16_t> counterval TEST_SUITE("BackendProfilingTestSuite") { + +#if !defined(__APPLE__) + TEST_CASE("BackendProfilingCounterRegisterMockBackendTest") { arm::pipe::LogLevelSwapper logLevelSwapper(arm::pipe::LogSeverity::Fatal); @@ -180,6 +183,8 @@ TEST_CASE("BackendProfilingCounterRegisterMockBackendTest") ConvertExternalProfilingOptions(options.m_ProfilingOptions), true); } +#endif + TEST_CASE("TestBackendCounters") { arm::pipe::LogLevelSwapper logLevelSwapper(arm::pipe::LogSeverity::Fatal); @@ -504,6 +509,8 @@ TEST_CASE("TestBackendCounterLogging") CHECK(ss.str().find("ActivateCounters example test error") != std::string::npos); } +#if !defined(__APPLE__) + TEST_CASE("BackendProfilingContextGetSendTimelinePacket") { arm::pipe::LogLevelSwapper logLevelSwapper(arm::pipe::LogSeverity::Fatal); @@ -578,4 +585,6 @@ TEST_CASE("GetProfilingGuidGenerator") options.m_ProfilingOptions.m_EnableProfiling = false; } +#endif + } diff --git a/src/backends/backendsCommon/test/DynamicBackendTests.cpp b/src/backends/backendsCommon/test/DynamicBackendTests.cpp index 72688adcbd..a063bcfaf1 100644 --- a/src/backends/backendsCommon/test/DynamicBackendTests.cpp +++ b/src/backends/backendsCommon/test/DynamicBackendTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017, 2024 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // @@ -9,6 +9,8 @@ #include <doctest/doctest.h> +#if !defined(__APPLE__) + TEST_SUITE("DynamicBackendTests") { ARMNN_SIMPLE_TEST_CASE(OpenCloseHandle, OpenCloseHandleTestImpl); @@ -78,3 +80,5 @@ ARMNN_SIMPLE_TEST_CASE(SampleDynamicBackendEndToEnd, SampleDynamicBackendEndToEn #endif } + +#endif diff --git a/src/backends/neon/test/NeonCreateWorkloadTests.cpp b/src/backends/neon/test/NeonCreateWorkloadTests.cpp index 9c32e32375..d5343edc70 100644 --- a/src/backends/neon/test/NeonCreateWorkloadTests.cpp +++ b/src/backends/neon/test/NeonCreateWorkloadTests.cpp @@ -81,7 +81,7 @@ static void NeonCreateActivationWorkloadTest() CHECK(TestNeonTensorHandleInfo(outputHandle, TensorInfo({1, 1}, DataType))); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateActivationFloat16Workload") { NeonCreateActivationWorkloadTest<DataType::Float16>(); @@ -114,7 +114,7 @@ static void NeonCreateElementwiseWorkloadTest() CHECK(TestNeonTensorHandleInfo(outputHandle, TensorInfo({2, 3}, DataType))); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateAdditionFloat16Workload") { NeonCreateElementwiseWorkloadTest<NeonAdditionWorkload, @@ -132,7 +132,7 @@ TEST_CASE("CreateAdditionFloatWorkload") DataType::Float32>(); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateSubtractionFloat16Workload") { NeonCreateElementwiseWorkloadTest<NeonSubtractionWorkload, @@ -158,7 +158,7 @@ TEST_CASE("CreateSubtractionUint8Workload") DataType::QAsymmU8>(); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateMultiplicationFloat16Workload") { NeonCreateElementwiseWorkloadTest<NeonMultiplicationWorkload, @@ -214,7 +214,7 @@ static void NeonCreateBatchNormalizationWorkloadTest(DataLayout dataLayout) CHECK(TestNeonTensorHandleInfo(outputHandle, TensorInfo(outputShape, DataType))); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateBatchNormalizationFloat16NchwWorkload") { NeonCreateBatchNormalizationWorkloadTest<NeonBatchNormalizationWorkload, DataType::Float16>(DataLayout::NCHW); @@ -256,7 +256,7 @@ static void NeonCreateConvolution2dWorkloadTest(DataLayout dataLayout = DataLayo CHECK(TestNeonTensorHandleInfo(outputHandle, TensorInfo(outputShape, DataType))); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateConvolution2dFloat16NchwWorkload") { NeonCreateConvolution2dWorkloadTest<DataType::Float16>(); @@ -266,8 +266,8 @@ TEST_CASE("CreateConvolution2dFloat16NhwcWorkload") { NeonCreateConvolution2dWorkloadTest<DataType::Float16>(DataLayout::NHWC); } - #endif + TEST_CASE("CreateConvolution2dFloatNchwWorkload") { NeonCreateConvolution2dWorkloadTest<DataType::Float32>(); @@ -326,7 +326,7 @@ TEST_CASE("CreateDepthWiseConvolution2dFloat32NhwcWorkload") NeonCreateDepthWiseConvolutionWorkloadTest<DataType::Float32>(DataLayout::NHWC); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateDepthWiseConvolution2dFloat16NhwcWorkload") { NeonCreateDepthWiseConvolutionWorkloadTest<DataType::Float16>(DataLayout::NHWC); @@ -354,7 +354,7 @@ static void NeonCreateFullyConnectedWorkloadTest() CHECK(TestNeonTensorHandleInfo(outputHandle, TensorInfo({3, 7}, DataType, outputQScale))); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateFullyConnectedFloat16Workload") { NeonCreateFullyConnectedWorkloadTest<NeonFullyConnectedWorkload, DataType::Float16>(); @@ -397,7 +397,7 @@ static void NeonCreateNormalizationWorkloadTest(DataLayout dataLayout) CHECK(TestNeonTensorHandleInfo(outputHandle, TensorInfo(outputShape, DataType))); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateNormalizationFloat16NchwWorkload") { NeonCreateNormalizationWorkloadTest<NeonNormalizationFloatWorkload, DataType::Float16>(DataLayout::NCHW); @@ -440,7 +440,7 @@ static void NeonCreatePooling2dWorkloadTest(DataLayout dataLayout = DataLayout:: CHECK(TestNeonTensorHandleInfo(outputHandle, TensorInfo(outputShape, DataType))); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreatePooling2dFloat16Workload") { NeonCreatePooling2dWorkloadTest<DataType::Float16>(); @@ -493,7 +493,7 @@ static void NeonCreatePreluWorkloadTest(const armnn::TensorShape& inputShape, CHECK(TestNeonTensorHandleInfo(outputHandle, TensorInfo(outputShape, dataType))); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreatePreluFloat16Workload") { NeonCreatePreluWorkloadTest({ 1, 4, 1, 2 }, { 5, 4, 3, 1 }, { 5, 4, 3, 2 }, DataType::Float16); @@ -527,7 +527,7 @@ static void NeonCreateReshapeWorkloadTest() CHECK(TestNeonTensorHandleInfo(outputHandle, TensorInfo({1, 4}, DataType))); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateReshapeFloat16Workload") { NeonCreateReshapeWorkloadTest<DataType::Float16>(); @@ -622,7 +622,7 @@ static void NeonCreateSoftmaxWorkloadTest() CHECK(TestNeonTensorHandleInfo(outputHandle, tensorInfo)); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateSoftmaxFloat16Workload") { NeonCreateSoftmaxWorkloadTest<NeonSoftmaxWorkload, DataType::Float16>(); @@ -816,7 +816,7 @@ static void NeonCreateL2NormalizationWorkloadTest(DataLayout dataLayout) CHECK(TestNeonTensorHandleInfo(outputHandle, TensorInfo(outputShape, DataType))); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateL2NormalizationFloat16NchwWorkload") { NeonCreateL2NormalizationWorkloadTest<NeonL2NormalizationFloatWorkload, DataType::Float16>(DataLayout::NCHW); @@ -857,7 +857,7 @@ static void NeonCreateLogSoftmaxWorkloadTest() CHECK(TestNeonTensorHandleInfo(outputHandle, tensorInfo)); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateLogSoftmaxFloat16Workload") { NeonCreateLogSoftmaxWorkloadTest<NeonLogSoftmaxWorkload, DataType::Float16>(); @@ -975,7 +975,7 @@ TEST_CASE("CreateStackFloat32Workload") NeonCreateStackWorkloadTest<armnn::DataType::Float32>({ 3, 4, 5 }, { 3, 4, 2, 5 }, 2, 2); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateStackFloat16Workload") { NeonCreateStackWorkloadTest<armnn::DataType::Float16>({ 3, 4, 5 }, { 3, 4, 2, 5 }, 2, 2); diff --git a/src/backends/neon/test/NeonLayerTests.cpp b/src/backends/neon/test/NeonLayerTests.cpp index 9db6d2c2e6..366f5a658b 100644 --- a/src/backends/neon/test/NeonLayerTests.cpp +++ b/src/backends/neon/test/NeonLayerTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2017-2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -264,7 +264,7 @@ ARMNN_AUTO_TEST_CASE_WITH_THF(Convolution3d2x2x2Stride3x3x3SmallTestFloat32, Convolution3d2x2x2Stride3x3x3SmallFloat32Test, false, DataLayout::NDHWC) -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) ARMNN_AUTO_TEST_CASE_WITH_THF(Convolution3d2x3x3TestFloat16, Convolution3d2x3x3Float16Test, true, diff --git a/src/backends/neon/test/NeonRuntimeTests.cpp b/src/backends/neon/test/NeonRuntimeTests.cpp index ee5666d5cd..d06319d597 100644 --- a/src/backends/neon/test/NeonRuntimeTests.cpp +++ b/src/backends/neon/test/NeonRuntimeTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017, 2024 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // @@ -66,9 +66,13 @@ TEST_CASE("RuntimeMemoryLeaksCpuAcc") } #endif +#if !defined(__APPLE__) + TEST_CASE("ProfilingPostOptimisationStructureCpuAcc") { VerifyPostOptimisationStructureTestImpl(armnn::Compute::CpuAcc); } -}
\ No newline at end of file +#endif + +} diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp index 29d3d7d393..b641b5c336 100644 --- a/src/profiling/test/ProfilingTests.cpp +++ b/src/profiling/test/ProfilingTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2019 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2019, 2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -58,6 +58,9 @@ using PacketType = MockProfilingConnection::PacketType; TEST_SUITE("ExternalProfiling") { + +#if !defined(__APPLE__) + TEST_CASE("CheckCommandHandlerKeyComparisons") { arm::pipe::CommandHandlerKey testKey1_0(1, 1, 1); @@ -3858,4 +3861,6 @@ TEST_CASE("CheckFileFormat") { } } +#endif + } diff --git a/src/profiling/test/SendTimelinePacketTests.cpp b/src/profiling/test/SendTimelinePacketTests.cpp index ed2c862b54..1d43415659 100644 --- a/src/profiling/test/SendTimelinePacketTests.cpp +++ b/src/profiling/test/SendTimelinePacketTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2019 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2019, 2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -29,6 +29,9 @@ using namespace arm::pipe; TEST_SUITE("SendTimelinePacketTests") { + +#if !defined(__APPLE__) + TEST_CASE("SendTimelineMessageDirectoryPackageTest") { MockBufferManager mockBuffer(512); @@ -505,4 +508,6 @@ TEST_CASE("CheckStaticGuidsAndEvents") CHECK(LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS == expectedEol); } +#endif + } diff --git a/src/timelineDecoder/tests/JSONTimelineDecoderTests.cpp b/src/timelineDecoder/tests/JSONTimelineDecoderTests.cpp index 2c4da54207..3e4bc6a4fb 100644 --- a/src/timelineDecoder/tests/JSONTimelineDecoderTests.cpp +++ b/src/timelineDecoder/tests/JSONTimelineDecoderTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -682,6 +682,8 @@ void RunSimpleModelThroughDecoder(JSONTimelineDecoder& timelineDecoder) timelineDecoder.CreateRelationship(relationship90); } +#if !defined(__APPLE__) + TEST_CASE("JSONTimelineDecoderTestStructure") { JSONTimelineDecoder timelineDecoder; @@ -823,4 +825,7 @@ TEST_CASE("JSONTimelineDecoderTestJSON") // Remove temporary file fs::remove(tempFile); } -}
\ No newline at end of file + +#endif + +} diff --git a/tests/profiling/gatordmock/tests/GatordMockTests.cpp b/tests/profiling/gatordmock/tests/GatordMockTests.cpp index abe69a4f26..9c11b4b39d 100644 --- a/tests/profiling/gatordmock/tests/GatordMockTests.cpp +++ b/tests/profiling/gatordmock/tests/GatordMockTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2017, 2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -31,6 +31,8 @@ using namespace armnn; using namespace std::this_thread; using namespace std::chrono_literals; +#if !defined(__APPLE__) + TEST_CASE("CounterCaptureHandlingTest") { arm::pipe::PacketVersionResolver packetVersionResolver; @@ -512,4 +514,6 @@ TEST_CASE("GatorDMockTimeLineActivation") GetProfilingService(&runtime).Disconnect(); } +#endif + } |