arovir01 | 43095f3 | 2018-10-09 18:04:24 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 6 | #include "NeonWorkloadFactoryHelper.hpp" |
| 7 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 8 | #include <layers/ConvertFp16ToFp32Layer.hpp> |
| 9 | #include <layers/ConvertFp32ToFp16Layer.hpp> |
| 10 | #include <test/TensorHelpers.hpp> |
arovir01 | 43095f3 | 2018-10-09 18:04:24 +0100 | [diff] [blame] | 11 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 12 | #include <backendsCommon/CpuTensorHandle.hpp> |
| 13 | #include <neon/NeonWorkloadFactory.hpp> |
| 14 | #include <backendsCommon/test/IsLayerSupportedTestImpl.hpp> |
| 15 | #include <backendsCommon/test/LayerTests.hpp> |
arovir01 | 43095f3 | 2018-10-09 18:04:24 +0100 | [diff] [blame] | 16 | |
| 17 | #include <boost/test/unit_test.hpp> |
| 18 | |
| 19 | #include <string> |
| 20 | |
| 21 | BOOST_AUTO_TEST_SUITE(NeonLayerSupport) |
| 22 | |
| 23 | BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat16Neon) |
| 24 | { |
Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 25 | armnn::NeonWorkloadFactory factory = NeonWorkloadFactoryHelper::GetFactory(); |
arovir01 | 43095f3 | 2018-10-09 18:04:24 +0100 | [diff] [blame] | 26 | IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::Float16>(&factory); |
| 27 | } |
| 28 | |
| 29 | BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat32Neon) |
| 30 | { |
Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 31 | armnn::NeonWorkloadFactory factory = NeonWorkloadFactoryHelper::GetFactory(); |
arovir01 | 43095f3 | 2018-10-09 18:04:24 +0100 | [diff] [blame] | 32 | IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::Float32>(&factory); |
| 33 | } |
| 34 | |
| 35 | BOOST_AUTO_TEST_CASE(IsLayerSupportedUint8Neon) |
| 36 | { |
Aron Virginas-Tar | 5605519 | 2018-11-12 18:10:43 +0000 | [diff] [blame] | 37 | armnn::NeonWorkloadFactory factory = NeonWorkloadFactoryHelper::GetFactory(); |
arovir01 | 43095f3 | 2018-10-09 18:04:24 +0100 | [diff] [blame] | 38 | IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::QuantisedAsymm8>(&factory); |
| 39 | } |
| 40 | |
| 41 | BOOST_AUTO_TEST_CASE(IsConvertFp16ToFp32SupportedNeon) |
| 42 | { |
| 43 | std::string reasonIfUnsupported; |
| 44 | |
| 45 | bool result = IsConvertLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::ConvertFp16ToFp32Layer, |
| 46 | armnn::DataType::Float16, armnn::DataType::Float32>(reasonIfUnsupported); |
| 47 | |
| 48 | BOOST_CHECK(result); |
| 49 | } |
| 50 | |
| 51 | BOOST_AUTO_TEST_CASE(IsConvertFp32ToFp16SupportedNeon) |
| 52 | { |
| 53 | std::string reasonIfUnsupported; |
| 54 | |
| 55 | bool result = IsConvertLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::ConvertFp32ToFp16Layer, |
| 56 | armnn::DataType::Float32, armnn::DataType::Float16>(reasonIfUnsupported); |
| 57 | |
| 58 | BOOST_CHECK(result); |
| 59 | } |
| 60 | |
| 61 | BOOST_AUTO_TEST_SUITE_END() |