12 #include <boost/test/unit_test.hpp> 27 input->GetOutputSlot(0).Connect(add->GetInputSlot(1));
28 add->GetOutputSlot(0).Connect(output->GetInputSlot(0));
32 input->GetOutputSlot(0).SetTensorInfo(info);
33 add->GetOutputSlot(0).SetTensorInfo(info);
41 std::ostringstream ss;
42 optimizedNet->SerializeToDot(ss);
44 auto inputId = input->GetGuid();
45 auto addId = add->GetGuid();
46 auto outputId = output->GetGuid();
48 std::stringstream expected;
50 "digraph Optimized {\n" 51 " node [shape=\"record\"];\n" 52 " edge [fontsize=8 fontcolor=\"blue\" fontname=\"arial-bold\"];\n" 53 " " << inputId <<
" [label=\"{Input|LayerType : Input\\lBackendID : CpuRef\\l}\"];\n" 54 " " << addId <<
" [label=\"{Addition|LayerType : Addition\\lBackendID : CpuRef\\l}\"];\n" 55 " " << outputId <<
" [label=\"{Output|LayerType : Output\\lBackendID : CpuRef\\l}\"];\n" 56 " " << inputId <<
" -> " << addId <<
" [label=< [4] >];\n" 57 " " << inputId <<
" -> " << addId <<
" [label=< [4] >];\n" 58 " " << addId <<
" -> " << outputId <<
" [label=< [4] >];\n" 61 BOOST_TEST(ss.str() == expected.str());
115 BOOST_REQUIRE(optNet);
117 for (
auto&& layer : static_cast<armnn::OptimizedNetwork*>(optNet.get())->GetGraph())
122 #if defined(ARMCOMPUTENEON_ENABLED) 165 layer = net.AddActivationLayer(acDesc,
"ac");
171 layer = net.AddMultiplicationLayer(
"ml");
179 layer = net.AddSoftmaxLayer(softmaxDescriptor,
"sm");
185 layer = net.AddOutputLayer(0,
"ot");
227 layer = net.AddActivationLayer(acDesc,
"ac");
233 layer = net.AddMultiplicationLayer(
"ml");
241 layer = net.AddSoftmaxLayer(softmaxDescriptor,
"sm");
247 layer = net.AddOutputLayer(0,
"ot");
261 for (
auto&& layer : static_cast<armnn::OptimizedNetwork*>(optNet.get())->GetGraph())
264 BOOST_CHECK_NO_THROW(
265 layer->CreateWorkload(fact));
296 BOOST_REQUIRE(optNet);
298 for (
auto&& layer : static_cast<armnn::OptimizedNetwork*>(optNet.get())->GetGraph())
305 #if defined(ARMCOMPUTENEON_ENABLED) 314 #elif defined(ARMCOMPUTECL_ENABLED) BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
static IRuntimePtr Create(const CreationOptions &options)
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
IConnectableLayer * AddOutputLayer(LayerBindingId id, const char *name=nullptr) override
Adds an output layer to the network.
CPU Execution: Reference C++ kernels.
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr) override
Adds an input layer to the network.
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.
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
GPU Execution: OpenCL: ArmCompute.
An ActivationDescriptor for the ActivationLayer.
Private implementation of INetwork.
BOOST_AUTO_TEST_SUITE_END()
CPU Execution: NEON: ArmCompute.
IConnectableLayer * AddAdditionLayer(const char *name=nullptr) override
Adds an addition layer to the network.
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
virtual int Connect(IInputSlot &destination)=0
BOOST_AUTO_TEST_CASE(SerializeToDot)
armnn::Runtime::CreationOptions::ExternalProfilingOptions options
A NormalizationDescriptor for the NormalizationLayer.
A SoftmaxDescriptor for the SoftmaxLayer.
static INetworkPtr Create()