From 2883a86c5a167aea3c736529bff5921ab6cbc99c Mon Sep 17 00:00:00 2001 From: Tracy Narine Date: Mon, 26 Feb 2024 15:05:11 +0000 Subject: IVGCVSW-8172 Add macOS support to build tool setup * Updates build rules for platform * Failing unit tests excluded (dynamic backends, profiling) * install-packages.sh generates manual setup information Signed-off-by: Tracy Narine Change-Id: I2d3d434aa615a8796c0cb94cd5b9c35a5acfd148 --- src/armnn/Utils.cpp | 6 +++- src/armnn/test/RuntimeTests.cpp | 6 +++- .../backendsCommon/test/BackendProfilingTests.cpp | 11 ++++++- .../backendsCommon/test/DynamicBackendTests.cpp | 6 +++- src/backends/neon/test/NeonCreateWorkloadTests.cpp | 34 +++++++++++----------- src/backends/neon/test/NeonLayerTests.cpp | 4 +-- src/backends/neon/test/NeonRuntimeTests.cpp | 8 +++-- src/profiling/test/ProfilingTests.cpp | 7 ++++- src/profiling/test/SendTimelinePacketTests.cpp | 7 ++++- .../tests/JSONTimelineDecoderTests.cpp | 9 ++++-- 10 files changed, 69 insertions(+), 29 deletions(-) (limited to 'src') 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,16 +1,18 @@ // -// 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 #include +#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 @@ -67,6 +70,7 @@ bool NeonDetected() return false; } +#endif #endif // This method of Neon detection is only supported on Linux so in order to prevent a false negative 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 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 +#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(); @@ -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(); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateSubtractionFloat16Workload") { NeonCreateElementwiseWorkloadTest(); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateMultiplicationFloat16Workload") { NeonCreateElementwiseWorkloadTest(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(); @@ -266,8 +266,8 @@ TEST_CASE("CreateConvolution2dFloat16NhwcWorkload") { NeonCreateConvolution2dWorkloadTest(DataLayout::NHWC); } - #endif + TEST_CASE("CreateConvolution2dFloatNchwWorkload") { NeonCreateConvolution2dWorkloadTest(); @@ -326,7 +326,7 @@ TEST_CASE("CreateDepthWiseConvolution2dFloat32NhwcWorkload") NeonCreateDepthWiseConvolutionWorkloadTest(DataLayout::NHWC); } -#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(__APPLE__) TEST_CASE("CreateDepthWiseConvolution2dFloat16NhwcWorkload") { NeonCreateDepthWiseConvolutionWorkloadTest(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(); @@ -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(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(); @@ -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(); @@ -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(); @@ -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(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(); @@ -975,7 +975,7 @@ TEST_CASE("CreateStackFloat32Workload") NeonCreateStackWorkloadTest({ 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({ 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 + +} -- cgit v1.2.1