13 #include <doctest/doctest.h> 15 #include <common/include/LabelsAndEventClasses.hpp> 22 using namespace armnn;
30 bool WaitForPacketsSent(uint32_t timeout = 1000)
39 TEST_CASE(
"TestFileOnlyProfiling")
45 for (
auto const& backend : suitableBackends)
78 std::vector<armnn::BackendId> backendsVec {backend};
86 std::vector<float> inputData(16);
87 std::vector<float> outputData(16);
88 for (
unsigned int i = 0; i < 16; ++i) {
111 std::cout <<
error.what() << std::endl;
115 std::vector<std::string> expectedOutput;
116 expectedOutput.push_back(
"Entity [0] name = input type = layer");
117 expectedOutput.push_back(
" connection [17] from entity [0] to entity [1]");
118 expectedOutput.push_back(
" child: Entity [26] backendId = " + backend.Get() +
" type = workload");
119 expectedOutput.push_back(
"Entity [1] name = Rsqrt type = layer");
120 expectedOutput.push_back(
" connection [25] from entity [1] to entity [2]");
121 expectedOutput.push_back(
" child: Entity [18] backendId = " + backend.Get() +
" type = workload");
122 expectedOutput.push_back(
"Entity [2] name = output type = layer");
123 expectedOutput.push_back(
" child: Entity [30] backendId = " + backend.Get() +
" type = workload");
124 expectedOutput.push_back(
"Entity [6] processId = [processId] type = network");
125 expectedOutput.push_back(
" child: Entity [0] name = input type = layer");
126 expectedOutput.push_back(
" child: Entity [1] name = Rsqrt type = layer");
127 expectedOutput.push_back(
" child: Entity [2] name = output type = layer");
128 expectedOutput.push_back(
" execution: Entity [34] type = inference");
129 expectedOutput.push_back(
" event: [8] class [start_of_life]");
130 expectedOutput.push_back(
"Entity [18] backendId = " + backend.Get() +
" type = workload");
131 expectedOutput.push_back(
" execution: Entity [47] type = workload_execution");
132 expectedOutput.push_back(
"Entity [26] backendId = " + backend.Get() +
" type = workload");
133 expectedOutput.push_back(
" execution: Entity [39] type = workload_execution");
134 expectedOutput.push_back(
"Entity [30] backendId = " + backend.Get() +
" type = workload");
135 expectedOutput.push_back(
" execution: Entity [55] type = workload_execution");
136 expectedOutput.push_back(
"Entity [34] type = inference");
137 expectedOutput.push_back(
" child: Entity [39] type = workload_execution");
138 expectedOutput.push_back(
" child: Entity [47] type = workload_execution");
139 expectedOutput.push_back(
" child: Entity [55] type = workload_execution");
140 expectedOutput.push_back(
" event: [37] class [start_of_life]");
141 expectedOutput.push_back(
" event: [63] class [end_of_life]");
142 expectedOutput.push_back(
"Entity [39] type = workload_execution");
143 expectedOutput.push_back(
" event: [43] class [start_of_life]");
144 expectedOutput.push_back(
" event: [45] class [end_of_life]");
145 expectedOutput.push_back(
"Entity [47] type = workload_execution");
146 expectedOutput.push_back(
" event: [51] class [start_of_life]");
147 expectedOutput.push_back(
" event: [53] class [end_of_life]");
148 expectedOutput.push_back(
"Entity [55] type = workload_execution");
149 expectedOutput.push_back(
" event: [59] class [start_of_life]");
150 expectedOutput.push_back(
" event: [61] class [end_of_life]");
155 TEST_CASE(
"DumpOutgoingValidFileEndToEnd")
161 for (
auto const& backend : suitableBackends)
166 CHECK(!fs::exists(tempPath));
201 std::vector<BackendId> backendsVec{backend};
209 std::vector<float> inputData(16);
210 std::vector<float> outputData(16);
211 for (
unsigned int i = 0; i < 16; ++i) {
235 CHECK(fs::file_size(tempPath) > 0);
240 CHECK(fs::remove(tempPath));
TEST_SUITE("TestConstTensorLayerVisitor")
profiling::ProfilingService & GetProfilingService(armnn::RuntimeImpl *runtime)
TensorInfo GetInputTensorInfo(NetworkId networkId, LayerBindingId layerId) const
std::shared_ptr< ILocalPacketHandler > ILocalPacketHandlerSharedPtr
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
std::string m_OutgoingCaptureFile
Status LoadNetwork(NetworkId &networkIdOut, IOptimizedNetworkPtr network)
Loads a complete network into the Runtime.
std::vector< std::pair< LayerBindingId, class ConstTensor > > InputTensors
TensorInfo GetOutputTensorInfo(NetworkId networkId, LayerBindingId layerId) const
const std::vector< arm::pipe::ProfilingException > & GetErrors() const
Copyright (c) 2021 ARM Limited and Contributors.
Status EnqueueWorkload(NetworkId networkId, const InputTensors &inputTensors, const OutputTensors &outputTensors)
std::vector< BackendId > GetSuitableBackendRegistered()
Returns a vector of CpuRef, CpuAcc or GpuAcc backends if they where registered.
std::string m_IncomingCaptureFile
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
void ResetGuidGenerator()
bool WaitForPacketSent(ProfilingService &instance, uint32_t timeout=1000)
A tensor defined by a TensorInfo (shape and data type) and a mutable backing store.
std::vector< armnn::profiling::ILocalPacketHandlerSharedPtr > m_LocalPacketHandlers
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.
bool CompareOutput(std::vector< std::string > output, std::vector< std::string > expectedOutput)
const IDeviceSpec & GetDeviceSpec() const
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
std::vector< std::pair< LayerBindingId, class Tensor > > OutputTensors
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
void ResetExternalProfilingOptions(const ExternalProfilingOptions &options, bool resetProfilingService=false)
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
std::vector< std::string > GetModelDescription(const TimelineModel &model)
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.
fs::path NamedTempFile(const char *fileName)
Returns a path to a file in the system temporary folder. If the file existed it will be deleted...
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
virtual int Connect(IInputSlot &destination)=0
ExternalProfilingOptions m_ProfilingOptions
static INetworkPtr Create(NetworkOptions networkOptions={})