From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/_flow_control_8cpp_source.xhtml | 138 ++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 20.02/_flow_control_8cpp_source.xhtml (limited to '20.02/_flow_control_8cpp_source.xhtml') diff --git a/20.02/_flow_control_8cpp_source.xhtml b/20.02/_flow_control_8cpp_source.xhtml new file mode 100644 index 0000000000..df374d45b9 --- /dev/null +++ b/20.02/_flow_control_8cpp_source.xhtml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/test/FlowControl.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
FlowControl.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include <armnn/Descriptors.hpp>
7 #include <armnn/IRuntime.hpp>
8 #include <armnn/INetwork.hpp>
9 
10 #include <boost/test/unit_test.hpp>
11 
12 #include <set>
13 
14 BOOST_AUTO_TEST_SUITE(FlowControl)
15 
16 BOOST_AUTO_TEST_CASE(ErrorOnLoadNetwork)
17 {
18  using namespace armnn;
19 
20  // Create runtime in which test will run
22  IRuntimePtr runtime(IRuntime::Create(options));
23 
24  // build up the structure of the network
25  // It's equivalent to something like
26  // if (0) {} else {}
28 
29  std::vector<uint8_t> falseData = {0};
30  ConstTensor falseTensor(armnn::TensorInfo({1}, armnn::DataType::Boolean), falseData);
31  IConnectableLayer* constLayer = net->AddConstantLayer(falseTensor, "const");
33 
34  IConnectableLayer* input = net->AddInputLayer(0);
35 
36  IConnectableLayer* switchLayer = net->AddSwitchLayer("switch");
37  IConnectableLayer* mergeLayer = net->AddMergeLayer("merge");
38 
39  IConnectableLayer* output = net->AddOutputLayer(0);
40 
41  input->GetOutputSlot(0).Connect(switchLayer->GetInputSlot(0));
42  constLayer->GetOutputSlot(0).Connect(switchLayer->GetInputSlot(1));
43  switchLayer->GetOutputSlot(0).Connect(mergeLayer->GetInputSlot(0));
44  switchLayer->GetOutputSlot(1).Connect(mergeLayer->GetInputSlot(1));
45  mergeLayer->GetOutputSlot(0).Connect(output->GetInputSlot(0));
46 
47  // optimize the network
48  std::vector<BackendId> backends = {Compute::CpuRef};
49  IOptimizedNetworkPtr optNet = Optimize(*net, backends, runtime->GetDeviceSpec());
50  BOOST_CHECK(!optNet); // Should have failed to optimise, as flow control is not yet implemented
51 }
52 
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
+
static IRuntimePtr Create(const CreationOptions &options)
Definition: Runtime.cpp:32
+
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:61
+ +
CPU Execution: Reference C++ kernels.
+ +
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
Definition: IRuntime.hpp:24
+ +
Copyright (c) 2020 ARM Limited.
+
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
+
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
+
IOptimizedNetworkPtr Optimize(const INetwork &network, const std::vector< BackendId > &backendPreferences, const IDeviceSpec &deviceSpec, const OptimizerOptions &options=OptimizerOptions(), Optional< std::vector< std::string > &> messages=EmptyOptional())
Create an optimized version of the network.
Definition: Network.cpp:890
+
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition: Tensor.hpp:199
+
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
Definition: INetwork.hpp:566
+ + +
BOOST_AUTO_TEST_SUITE_END()
+ +
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
+
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0
Get the const output slot handle by slot index.
+
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
Definition: INetwork.hpp:101
+
virtual int Connect(IInputSlot &destination)=0
+
armnn::Runtime::CreationOptions::ExternalProfilingOptions options
+
BOOST_AUTO_TEST_CASE(ErrorOnLoadNetwork)
Definition: FlowControl.cpp:16
+
static INetworkPtr Create()
Definition: Network.cpp:49
+
+
+ + + + -- cgit v1.2.1