2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include <backendsCommon/test/EndToEndTestImpl.hpp>
8 #include <boost/test/unit_test.hpp>
10 BOOST_AUTO_TEST_SUITE(NeonEndToEnd)
12 BOOST_AUTO_TEST_CASE(ConstantUsage_Neon_Float32)
14 std::vector<armnn::BackendId> backends = {armnn::Compute::CpuAcc};
15 BOOST_TEST(ConstantUsageFloat32Test(backends));
18 BOOST_AUTO_TEST_CASE(FallbackToCpuRef)
20 using namespace armnn;
22 // Create runtime in which test will run and allow fallback to CpuRef.
23 IRuntime::CreationOptions options;
24 IRuntimePtr runtime(IRuntime::Create(options));
26 // Builds up the structure of the network.
27 INetworkPtr net(INetwork::Create());
29 IConnectableLayer* input = net->AddInputLayer(0);
31 // This layer configuration isn't supported by CpuAcc but we allow fallback to CpuRef so it shoud pass.
32 NormalizationDescriptor descriptor;
33 IConnectableLayer* pooling = net->AddNormalizationLayer(descriptor);
35 IConnectableLayer* output = net->AddOutputLayer(0);
37 input->GetOutputSlot(0).Connect(pooling->GetInputSlot(0));
38 pooling->GetOutputSlot(0).Connect(output->GetInputSlot(0));
40 input->GetOutputSlot(0).SetTensorInfo(TensorInfo({ 1, 1, 4, 4 }, DataType::Float32));
41 pooling->GetOutputSlot(0).SetTensorInfo(TensorInfo({ 1, 1, 4, 4 }, DataType::Float32));
43 // optimize the network
44 std::vector<BackendId> backends = {Compute::CpuAcc, Compute::CpuRef};
45 IOptimizedNetworkPtr optNet = Optimize(*net, backends, runtime->GetDeviceSpec());
47 // Load it into the runtime. It should pass.
49 BOOST_TEST(runtime->LoadNetwork(netId, std::move(optNet)) == Status::Success);
52 BOOST_AUTO_TEST_SUITE_END()