From a34c98d17b6784e4b5b3a9d77654717e86517bab Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Mon, 5 Jul 2021 12:56:46 +0100 Subject: Avoid empty test suites Refactor code around conditionally-compiled tests to avoid declaring empty test suites, as this can cause unused function warnings to be issued under certain combinations of compiler, warning level, and doctest version. Signed-off-by: Matthew Bentham Change-Id: Ib501aef80475538a725b857d9c31d1d2f96b124d --- src/armnn/test/optimizations/FuseActivationTests.cpp | 15 ++++++++------- src/armnn/test/optimizations/ReduceMultipleAxesTests.cpp | 14 ++++++++++---- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/armnn/test/optimizations/FuseActivationTests.cpp b/src/armnn/test/optimizations/FuseActivationTests.cpp index 35b5bbc2da..24ea8f6680 100644 --- a/src/armnn/test/optimizations/FuseActivationTests.cpp +++ b/src/armnn/test/optimizations/FuseActivationTests.cpp @@ -17,9 +17,7 @@ using namespace armnn; -TEST_SUITE("Optimizer") -{ -namespace armnn +namespace { template @@ -471,10 +469,11 @@ bool FuseActivationSimpleTest(ActivationDescriptor activationDescriptor, Compute return success; } -} // namespace armnn +} -using namespace armnn; #if defined(ARMCOMPUTENEON_ENABLED) +TEST_SUITE("Optimizer") +{ // ReLu fused into Receiver Layers Float32 TEST_CASE("FuseReLUIntoConvFloat32CpuAccTest") { @@ -712,9 +711,12 @@ TEST_CASE("LayerFollowedByActivationQAsymmU8CpuAccTest") (activationDescriptor, Compute::CpuAcc)), "FullyConnected + Activation function " << static_cast(activationDescriptor.m_Function)); } +} #endif #if defined(ARMCOMPUTECL_ENABLED) +TEST_SUITE("Optimizer") +{ // ReLu fused into Receiver Layers Float32 TEST_CASE("FuseReLUIntoConvFloat32GpuAccTest") { @@ -1176,6 +1178,5 @@ TEST_CASE("LayerFollowedByActivationQAsymmU8GpuAccTest") (activationDescriptor, Compute::GpuAcc)), "FullyConnected + Activation function " << static_cast(activationDescriptor.m_Function)); } +} #endif - -} \ No newline at end of file diff --git a/src/armnn/test/optimizations/ReduceMultipleAxesTests.cpp b/src/armnn/test/optimizations/ReduceMultipleAxesTests.cpp index df9a0dbc39..0be8857224 100644 --- a/src/armnn/test/optimizations/ReduceMultipleAxesTests.cpp +++ b/src/armnn/test/optimizations/ReduceMultipleAxesTests.cpp @@ -12,8 +12,9 @@ using namespace armnn; -TEST_SUITE("Optimizer_ReduceMultipleAxes") +namespace { +#if defined(ARMCOMPUTENEON_ENABLED)||defined(ARMCOMPUTECL_ENABLED) INetworkPtr CreateSimpleReduceNetwork(ReduceDescriptor reduceDescriptor, TensorShape& inputShape, TensorShape& outputShape) @@ -243,9 +244,12 @@ void ReduceSumWithThreeAxesTest(Compute backendId) reduceDescriptor.m_vAxis.size(), backendId); } +#endif +} -using namespace armnn; #if defined(ARMCOMPUTENEON_ENABLED) +TEST_SUITE("Optimizer_ReduceMultipleAxesCpu") +{ TEST_CASE("ReduceSumWithTwoAxesKeepDimsCpuAccTest") { ReduceSumWithTwoAxesKeepDimsTest(Compute::CpuAcc); @@ -265,9 +269,12 @@ TEST_CASE("ReduceSumWithThreeAxesCpuAccTest") { ReduceSumWithThreeAxesTest(Compute::CpuAcc); } +} #endif #if defined(ARMCOMPUTECL_ENABLED) +TEST_SUITE("Optimizer_ReduceMultipleAxesGpu") +{ TEST_CASE("ReduceSumWithTwoAxesKeepDimsGpuAccTest") { ReduceSumWithTwoAxesKeepDimsTest(Compute::GpuAcc); @@ -287,6 +294,5 @@ TEST_CASE("ReduceSumWithThreeAxesGpuAccTest") { ReduceSumWithThreeAxesTest(Compute::GpuAcc); } +} #endif - -} \ No newline at end of file -- cgit v1.2.1