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