Aron Virginas-Tar | 7010400 | 2018-10-24 15:33:28 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 6 | #include <backendsCommon/test/EndToEndTestImpl.hpp> |
narpra01 | b9546cf | 2018-11-20 15:21:28 +0000 | [diff] [blame] | 7 | #include <backendsCommon/test/MergerTestImpl.hpp> |
Nattapat Chaimanowong | c6a41ff | 2019-01-29 09:56:02 +0000 | [diff] [blame] | 8 | #include <backendsCommon/test/ArithmeticTestImpl.hpp> |
Aron Virginas-Tar | 7010400 | 2018-10-24 15:33:28 +0100 | [diff] [blame] | 9 | |
| 10 | #include <boost/test/unit_test.hpp> |
| 11 | |
| 12 | BOOST_AUTO_TEST_SUITE(ClEndToEnd) |
| 13 | |
narpra01 | b9546cf | 2018-11-20 15:21:28 +0000 | [diff] [blame] | 14 | std::vector<armnn::BackendId> defaultBackends = {armnn::Compute::GpuAcc}; |
| 15 | |
Aron Virginas-Tar | 7010400 | 2018-10-24 15:33:28 +0100 | [diff] [blame] | 16 | BOOST_AUTO_TEST_CASE(ConstantUsage_Cl_Float32) |
| 17 | { |
narpra01 | b9546cf | 2018-11-20 15:21:28 +0000 | [diff] [blame] | 18 | ConstantUsageFloat32Test(defaultBackends); |
| 19 | } |
| 20 | |
| 21 | BOOST_AUTO_TEST_CASE(ClMergerEndToEndDim0Test) |
| 22 | { |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 23 | MergerDim0EndToEnd<armnn::DataType::Float32>(defaultBackends); |
narpra01 | b9546cf | 2018-11-20 15:21:28 +0000 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | BOOST_AUTO_TEST_CASE(ClMergerEndToEndDim0Uint8Test) |
| 27 | { |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 28 | MergerDim0EndToEnd<armnn::DataType::QuantisedAsymm8>(defaultBackends); |
narpra01 | b9546cf | 2018-11-20 15:21:28 +0000 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | BOOST_AUTO_TEST_CASE(ClMergerEndToEndDim1Test) |
| 32 | { |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 33 | MergerDim1EndToEnd<armnn::DataType::Float32>(defaultBackends); |
narpra01 | b9546cf | 2018-11-20 15:21:28 +0000 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | BOOST_AUTO_TEST_CASE(ClMergerEndToEndDim1Uint8Test) |
| 37 | { |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 38 | MergerDim1EndToEnd<armnn::DataType::QuantisedAsymm8>(defaultBackends); |
narpra01 | b9546cf | 2018-11-20 15:21:28 +0000 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | BOOST_AUTO_TEST_CASE(ClMergerEndToEndDim3Test) |
| 42 | { |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 43 | MergerDim3EndToEnd<armnn::DataType::Float32>(defaultBackends); |
narpra01 | b9546cf | 2018-11-20 15:21:28 +0000 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | BOOST_AUTO_TEST_CASE(ClMergerEndToEndDim3Uint8Test) |
| 47 | { |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 48 | MergerDim3EndToEnd<armnn::DataType::QuantisedAsymm8>(defaultBackends); |
Aron Virginas-Tar | 7010400 | 2018-10-24 15:33:28 +0100 | [diff] [blame] | 49 | } |
| 50 | |
Nattapat Chaimanowong | c6a41ff | 2019-01-29 09:56:02 +0000 | [diff] [blame] | 51 | BOOST_AUTO_TEST_CASE(ClGreaterSimpleEndToEndTest) |
| 52 | { |
| 53 | const std::vector<uint8_t> expectedOutput({ 0, 0, 0, 0, 1, 1, 1, 1, |
| 54 | 0, 0, 0, 0, 0, 0, 0, 0 }); |
| 55 | |
| 56 | ArithmeticSimpleEndToEnd<armnn::DataType::Float32, armnn::DataType::Boolean>(defaultBackends, |
| 57 | LayerType::Greater, |
| 58 | expectedOutput); |
| 59 | } |
| 60 | |
| 61 | BOOST_AUTO_TEST_CASE(ClGreaterSimpleEndToEndUint8Test) |
| 62 | { |
| 63 | const std::vector<uint8_t> expectedOutput({ 0, 0, 0, 0, 1, 1, 1, 1, |
| 64 | 0, 0, 0, 0, 0, 0, 0, 0 }); |
| 65 | |
| 66 | ArithmeticSimpleEndToEnd<armnn::DataType::QuantisedAsymm8, armnn::DataType::Boolean>(defaultBackends, |
| 67 | LayerType::Greater, |
| 68 | expectedOutput); |
| 69 | } |
| 70 | |
| 71 | BOOST_AUTO_TEST_CASE(ClGreaterBroadcastEndToEndTest) |
| 72 | { |
| 73 | const std::vector<uint8_t> expectedOutput({ 0, 1, 0, 0, 0, 1, |
| 74 | 1, 1, 1, 1, 1, 1 }); |
| 75 | |
| 76 | ArithmeticBroadcastEndToEnd<armnn::DataType::Float32, armnn::DataType::Boolean>(defaultBackends, |
| 77 | LayerType::Greater, |
| 78 | expectedOutput); |
| 79 | } |
| 80 | |
| 81 | BOOST_AUTO_TEST_CASE(ClGreaterBroadcastEndToEndUint8Test) |
| 82 | { |
| 83 | const std::vector<uint8_t> expectedOutput({ 0, 1, 0, 0, 0, 1, |
| 84 | 1, 1, 1, 1, 1, 1 }); |
| 85 | |
| 86 | ArithmeticBroadcastEndToEnd<armnn::DataType::QuantisedAsymm8, armnn::DataType::Boolean>(defaultBackends, |
| 87 | LayerType::Greater, |
| 88 | expectedOutput); |
| 89 | } |
| 90 | |
| 91 | |
Aron Virginas-Tar | 7010400 | 2018-10-24 15:33:28 +0100 | [diff] [blame] | 92 | BOOST_AUTO_TEST_SUITE_END() |