aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Bentham <matthew.bentham@arm.com>2021-07-05 12:56:46 +0100
committerMatthew Sloyan <matthew.sloyan@arm.com>2021-07-16 15:59:44 +0000
commita34c98d17b6784e4b5b3a9d77654717e86517bab (patch)
treef48ad62a9cf8ff38ffe438881d28b09a8050134e
parent18bf43d9caeb7f482e0beaef45202b6638d48a8c (diff)
downloadarmnn-a34c98d17b6784e4b5b3a9d77654717e86517bab.tar.gz
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 <matthew.bentham@arm.com> Change-Id: Ib501aef80475538a725b857d9c31d1d2f96b124d
-rw-r--r--src/armnn/test/optimizations/FuseActivationTests.cpp15
-rw-r--r--src/armnn/test/optimizations/ReduceMultipleAxesTests.cpp14
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<typename T>
@@ -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<int>(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<int>(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