MCPcopy Create free account
hub / github.com/ARM-software/armnn / CheckOutOfScopeWorkingCopy

Function CheckOutOfScopeWorkingCopy

src/armnn/test/SubgraphViewTests.cpp:2118–2151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2116}
2117
2118SubgraphView CheckOutOfScopeWorkingCopy()
2119{
2120 Graph graph;
2121
2122 auto input = graph.AddLayer<InputLayer>(0, "Input");
2123 auto activation = graph.AddLayer<ActivationLayer>(ActivationDescriptor{}, "Activation");
2124 auto output = graph.AddLayer<OutputLayer>(1, "Output");
2125
2126 input->GetOutputSlot(0).Connect(activation->GetInputSlot(0));
2127 activation->GetOutputSlot(0).Connect(output->GetInputSlot(0));
2128
2129 //Add in out of order
2130 auto shared = CreateSubgraphViewFrom({activation},
2131 {&activation->GetInputSlot(0)},
2132 {&activation->GetOutputSlot(0)});
2133
2134 auto workingCopy = shared->GetWorkingCopy();
2135
2136 // Check InputSlots are same as original
2137 auto boundaryOutputSlot = GetConnection(workingCopy.GetIInputSlots()[0], workingCopy, *shared);
2138 CHECK(boundaryOutputSlot);
2139
2140 auto inputSlots = workingCopy.GetOriginalInputSlots();
2141 CHECK(inputSlots[0]->GetConnection() == boundaryOutputSlot);
2142
2143 // Check OutputSlots are same as original
2144 auto boundaryInputSlot = GetConnection(workingCopy.GetIOutputSlots()[0], 0U, workingCopy, *shared);
2145 CHECK(boundaryInputSlot);
2146
2147 auto outputSlots = workingCopy.GetOriginalOutputSlots();
2148 CHECK(outputSlots[0]->GetConnection(0) == boundaryInputSlot);
2149
2150 return workingCopy;
2151}
2152
2153TEST_CASE("SubgraphViewWorkingCopyOriginalSlots")
2154{

Callers 1

Calls 6

GetConnectionFunction · 0.85
GetOutputSlotMethod · 0.80
GetWorkingCopyMethod · 0.80
CreateSubgraphViewFromFunction · 0.70
GetConnectionMethod · 0.60
ConnectMethod · 0.45

Tested by

no test coverage detected