From 483c811ea6fd0e7801aac1afd979ed02a649064b Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Tue, 1 Jun 2021 09:24:52 +0100 Subject: 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 Signed-off-by: Sadik Armagan Change-Id: Iccde9d6640b534940292ff048fb80c00b38c4743 --- src/armnn/test/UnitTests.hpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/armnn/test/UnitTests.hpp') 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 #include + #include "TensorHelpers.hpp" + #include inline void ConfigureLoggingTest() @@ -38,11 +40,15 @@ template void CompareTestResultIfSupported(const std::string& testName, const LayerTestResult& 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()); } } -- cgit v1.2.1