IVGCVSW-3221 Refactor Mean ref workload and tests
* Renamed RefMeanFloat32Workload and RefMeanUint8Workload
to RefMeanWorkload, updated references to reflect this
change.
* Refactored RefFloorWorkload to use Decoders/Encoders,
to support the use of multiple data types.
* Deleted reference Unit8 Mean tests as they were
duplicates of the Float32 tests. Refactored these tests
to support multiple data types and updated references.
* Adjusted the values used in the tests' input tensors so
that they are more like floating point numbers
e.g. change 1.0f to 1.5f.
* Replace size_t with unsigned int in Mean ref workload,
for better compatibility with the Encoder/Decoder,
removed some unnecessary casts after this.
* Added ValidateTensorDataTypesMatch() function to
WorkloadData.cpp, added CreateIncorrectDimensionsErrorMsg
function to RefLayerSupport.cpp.
* Added passing and failing tests for ref IsMeanSupported.
Signed-off-by: James Conroy <james.conroy@arm.com>
Change-Id: Id3d44463d1385255c727a497d4026d21a49e7eb2
diff --git a/src/backends/reference/test/RefLayerSupportTests.cpp b/src/backends/reference/test/RefLayerSupportTests.cpp
index 2c7e17da..0d99b3e 100644
--- a/src/backends/reference/test/RefLayerSupportTests.cpp
+++ b/src/backends/reference/test/RefLayerSupportTests.cpp
@@ -14,6 +14,7 @@
#include <backendsCommon/test/IsLayerSupportedTestImpl.hpp>
#include <boost/test/unit_test.hpp>
+#include <boost/algorithm/string/trim.hpp>
#include <string>
@@ -130,4 +131,28 @@
BOOST_CHECK_EQUAL(reasonIfUnsupported, "Layer is not supported with float32 data type output");
}
+BOOST_AUTO_TEST_CASE(IsLayerSupportedMeanDimensionsReference)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsMeanLayerSupportedTests<armnn::RefWorkloadFactory,
+ armnn::DataType::Float32, armnn::DataType::Float32>(reasonIfUnsupported);
+
+ BOOST_CHECK(result);
+}
+
+BOOST_AUTO_TEST_CASE(IsLayerNotSupportedMeanDimensionsReference)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsMeanLayerNotSupportedTests<armnn::RefWorkloadFactory,
+ armnn::DataType::Float32, armnn::DataType::Float32>(reasonIfUnsupported);
+
+ BOOST_CHECK(!result);
+
+ boost::algorithm::trim(reasonIfUnsupported);
+ BOOST_CHECK_EQUAL(reasonIfUnsupported,
+ "Reference Mean: Expected 4 dimensions but got 2 dimensions instead, for the 'output' tensor.");
+}
+
BOOST_AUTO_TEST_SUITE_END()