aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/test/UnitTests.hpp
diff options
context:
space:
mode:
authorSadik Armagan <sadik.armagan@arm.com>2021-06-01 09:24:52 +0100
committerSadik Armagan <sadik.armagan@arm.com>2021-06-02 13:00:56 +0000
commit483c811ea6fd0e7801aac1afd979ed02a649064b (patch)
treea0969c8786528334b62043b40983fa21d54d524e /src/armnn/test/UnitTests.hpp
parent31f86bfeb311ccc0c6ed94c35a78a51551148ea4 (diff)
downloadarmnn-483c811ea6fd0e7801aac1afd979ed02a649064b.tar.gz
IVGCVSW-5962 Remove boost::multi_array
* Replaced all instances of boost::multi_array with flat vectors. * Updated LayerTestResult struct with new member variables. * Updated CompareTensor function to compare flat vectors and the shape. * Removed MakeTensor function from TensorHelpers.hpp. * Removed GetTensorShapeAsArray function from LayerTestResult.hpp. * Removed boost::array usage. * Removed boost::extents usages. * Removed boost::random usages. Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: Iccde9d6640b534940292ff048fb80c00b38c4743
Diffstat (limited to 'src/armnn/test/UnitTests.hpp')
-rw-r--r--src/armnn/test/UnitTests.hpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/armnn/test/UnitTests.hpp b/src/armnn/test/UnitTests.hpp
index b55b13d4c8..bb91c4d055 100644
--- a/src/armnn/test/UnitTests.hpp
+++ b/src/armnn/test/UnitTests.hpp
@@ -11,7 +11,9 @@
#include <backendsCommon/test/LayerTests.hpp>
#include <backendsCommon/test/WorkloadFactoryHelper.hpp>
+
#include "TensorHelpers.hpp"
+
#include <boost/test/unit_test.hpp>
inline void ConfigureLoggingTest()
@@ -38,11 +40,15 @@ template <typename T, std::size_t n>
void CompareTestResultIfSupported(const std::string& testName, const LayerTestResult<T, n>& testResult)
{
bool testNameIndicatesUnsupported = testName.find("UNSUPPORTED") != std::string::npos;
- BOOST_CHECK_MESSAGE(testNameIndicatesUnsupported != testResult.supported,
- "The test name does not match the supportedness it is reporting");
- if (testResult.supported)
+ BOOST_CHECK_MESSAGE(testNameIndicatesUnsupported != testResult.m_Supported,
+ "The test name does not match the supportedness it is reporting");
+ if (testResult.m_Supported)
{
- auto result = CompareTensors(testResult.output, testResult.outputExpected, testResult.compareBoolean);
+ auto result = CompareTensors(testResult.m_ActualData,
+ testResult.m_ExpectedData,
+ testResult.m_ActualShape,
+ testResult.m_ExpectedShape,
+ testResult.m_CompareBoolean);
BOOST_TEST(result.m_Result, result.m_Message.str());
}
}
@@ -53,11 +59,14 @@ void CompareTestResultIfSupported(const std::string& testName, const std::vector
bool testNameIndicatesUnsupported = testName.find("UNSUPPORTED") != std::string::npos;
for (unsigned int i = 0; i < testResult.size(); ++i)
{
- BOOST_CHECK_MESSAGE(testNameIndicatesUnsupported != testResult[i].supported,
- "The test name does not match the supportedness it is reporting");
- if (testResult[i].supported)
+ BOOST_CHECK_MESSAGE(testNameIndicatesUnsupported != testResult[i].m_Supported,
+ "The test name does not match the supportedness it is reporting");
+ if (testResult[i].m_Supported)
{
- auto result = CompareTensors(testResult[i].output, testResult[i].outputExpected);
+ auto result = CompareTensors(testResult[i].m_ActualData,
+ testResult[i].m_ExpectedData,
+ testResult[i].m_ActualShape,
+ testResult[i].m_ExpectedShape);
BOOST_TEST(result.m_Result, result.m_Message.str());
}
}