blob: 56955432b66600e6a60f62ed1a740f2f6b22ce5b [file] [log] [blame]
arovir0143095f32018-10-09 18:04:24 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
Aron Virginas-Tar56055192018-11-12 18:10:43 +00006#include "NeonWorkloadFactoryHelper.hpp"
7
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +00008#include <layers/ConvertFp16ToFp32Layer.hpp>
9#include <layers/ConvertFp32ToFp16Layer.hpp>
10#include <test/TensorHelpers.hpp>
arovir0143095f32018-10-09 18:04:24 +010011
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +000012#include <backendsCommon/CpuTensorHandle.hpp>
13#include <neon/NeonWorkloadFactory.hpp>
14#include <backendsCommon/test/IsLayerSupportedTestImpl.hpp>
15#include <backendsCommon/test/LayerTests.hpp>
arovir0143095f32018-10-09 18:04:24 +010016
17#include <boost/test/unit_test.hpp>
18
19#include <string>
20
21BOOST_AUTO_TEST_SUITE(NeonLayerSupport)
22
23BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat16Neon)
24{
Aron Virginas-Tar56055192018-11-12 18:10:43 +000025 armnn::NeonWorkloadFactory factory = NeonWorkloadFactoryHelper::GetFactory();
arovir0143095f32018-10-09 18:04:24 +010026 IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::Float16>(&factory);
27}
28
29BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat32Neon)
30{
Aron Virginas-Tar56055192018-11-12 18:10:43 +000031 armnn::NeonWorkloadFactory factory = NeonWorkloadFactoryHelper::GetFactory();
arovir0143095f32018-10-09 18:04:24 +010032 IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::Float32>(&factory);
33}
34
35BOOST_AUTO_TEST_CASE(IsLayerSupportedUint8Neon)
36{
Aron Virginas-Tar56055192018-11-12 18:10:43 +000037 armnn::NeonWorkloadFactory factory = NeonWorkloadFactoryHelper::GetFactory();
arovir0143095f32018-10-09 18:04:24 +010038 IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::QuantisedAsymm8>(&factory);
39}
40
41BOOST_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
51BOOST_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
61BOOST_AUTO_TEST_SUITE_END()