diff options
author | FrancisMurtagh <francis.murtagh@arm.com> | 2018-12-20 16:09:45 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2018-12-20 16:57:51 +0000 |
commit | 2262bbd746907b28f5a5c2f36c153503884a8b8f (patch) | |
tree | 890f9acb05c89071f5751d06b550a56a352e6a23 /src/backends/reference/test/RefEndToEndTests.cpp | |
parent | 4e6597a26059bfa31ea24e190e2afe0558cea4c8 (diff) | |
download | armnn-2262bbd746907b28f5a5c2f36c153503884a8b8f.tar.gz |
IVGCVSW-2401 & IVGCVSW-2402 Add end-to-end test for Greater/Equal Operator
* Add Arithmetic end-to-end test implementation
* Enable tests for float, Uint8 and Broadcast
Change-Id: I81c7096e9b6ad29eaa935b74ad5f30f823be2331
Diffstat (limited to 'src/backends/reference/test/RefEndToEndTests.cpp')
-rw-r--r-- | src/backends/reference/test/RefEndToEndTests.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/backends/reference/test/RefEndToEndTests.cpp b/src/backends/reference/test/RefEndToEndTests.cpp index 8ad6f5a4d1..9a4e60162f 100644 --- a/src/backends/reference/test/RefEndToEndTests.cpp +++ b/src/backends/reference/test/RefEndToEndTests.cpp @@ -5,6 +5,7 @@ #include <backendsCommon/test/EndToEndTestImpl.hpp> #include <backendsCommon/test/MergerTestImpl.hpp> +#include <backendsCommon/test/ArithmeticTestImpl.hpp> #include <boost/test/unit_test.hpp> #include <boost/test/execution_monitor.hpp> @@ -311,6 +312,69 @@ BOOST_AUTO_TEST_CASE(TrivialMin) BOOST_TEST(outputData[3] == 2); } +BOOST_AUTO_TEST_CASE(RefEqualSimpleEndToEndTest) +{ + const std::vector<float > expectedOutput({ 1, 1, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 1 }); + + ArithmeticSimpleEndToEnd<float>(defaultBackends, LayerType::Equal, expectedOutput); +} + +BOOST_AUTO_TEST_CASE(RefGreaterSimpleEndToEndTest) +{ + const std::vector<float> expectedOutput({ 0, 0, 0, 0, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0 }); + + ArithmeticSimpleEndToEnd<float>(defaultBackends, LayerType::Greater, expectedOutput); +} + +BOOST_AUTO_TEST_CASE(RefEqualSimpleEndToEndUint8Test) +{ + const std::vector<uint8_t> expectedOutput({ 1, 1, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 1 }); + + ArithmeticSimpleEndToEnd<uint8_t>(defaultBackends, LayerType::Equal, expectedOutput); +} + +BOOST_AUTO_TEST_CASE(RefGreaterSimpleEndToEndUint8Test) +{ + const std::vector<uint8_t> expectedOutput({ 0, 0, 0, 0, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0 }); + + ArithmeticSimpleEndToEnd<uint8_t>(defaultBackends, LayerType::Greater, expectedOutput); +} + +BOOST_AUTO_TEST_CASE(RefEqualBroadcastEndToEndTest) +{ + const std::vector<float > expectedOutput({ 1, 0, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0 }); + + ArithmeticBroadcastEndToEnd<float>(defaultBackends, LayerType::Equal, expectedOutput); +} + +BOOST_AUTO_TEST_CASE(RefGreaterBroadcastEndToEndTest) +{ + const std::vector<float> expectedOutput({ 0, 1, 0, 0, 0, 1, + 1, 1, 1, 1, 1, 1 }); + + ArithmeticBroadcastEndToEnd<float>(defaultBackends, LayerType::Greater, expectedOutput); +} + +BOOST_AUTO_TEST_CASE(RefEqualBroadcastEndToEndUint8Test) +{ + const std::vector<uint8_t > expectedOutput({ 1, 0, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0 }); + + ArithmeticBroadcastEndToEnd<uint8_t>(defaultBackends, LayerType::Equal, expectedOutput); +} + +BOOST_AUTO_TEST_CASE(RefGreaterBroadcastEndToEndUint8Test) +{ + const std::vector<uint8_t> expectedOutput({ 0, 1, 0, 0, 0, 1, + 1, 1, 1, 1, 1, 1 }); + + ArithmeticBroadcastEndToEnd<uint8_t>(defaultBackends, LayerType::Greater, expectedOutput); +} BOOST_AUTO_TEST_CASE(RefMergerEndToEndDim0Test) { |