45 TEST_CASE(
"RuntimeUnloadNetwork")
54 mockNetwork1->AddInputLayer(0,
"test layer");
56 runtime->LoadNetwork(networkIdentifier1,
Optimize(*mockNetwork1, backends, runtime->GetDeviceSpec()));
61 mockNetwork2->AddInputLayer(0,
"test layer");
62 runtime->LoadNetwork(networkIdentifier2,
Optimize(*mockNetwork2, backends, runtime->GetDeviceSpec()));
70 TEST_CASE(
"RuntimePreImportInputs")
77 auto inputLayer1 = testNetwork->AddInputLayer(0,
"input 1 layer");
78 auto inputLayer2 = testNetwork->AddInputLayer(1,
"input 2 layer");
79 auto addLayer = testNetwork->AddAdditionLayer(
"add layer");
80 auto outputLayer = testNetwork->AddOutputLayer(2,
"output layer");
84 inputLayer1->GetOutputSlot(0).Connect(addLayer->GetInputSlot(0));
85 inputLayer1->GetOutputSlot(0).SetTensorInfo(tensorInfo);
87 inputLayer2->GetOutputSlot(0).Connect(addLayer->GetInputSlot(1));
88 inputLayer2->GetOutputSlot(0).SetTensorInfo(tensorInfo);
90 addLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
91 addLayer->GetOutputSlot(0).SetTensorInfo(tensorInfo);
97 runtime->LoadNetwork(networkId,
98 Optimize(*testNetwork, backends, runtime->GetDeviceSpec()),
102 std::vector<int> inputData1(4, 10);
103 std::vector<int> inputData2(4, 20);
104 std::vector<int> output(4);
110 auto importedInputVec1 = runtime->ImportInputs(networkId, {{0, inputTensor1}});
111 CHECK(importedInputVec1.size() == 1);
112 CHECK(importedInputVec1[0] == 0);
114 auto memHandle = runtime->CreateWorkingMemHandle(networkId);
116 runtime->Execute(*memHandle.get(), {{1, inputTensor2}}, {{2, outputTensor}}, {0 });
117 for (
auto val: output) {
121 auto importedInputVec2 = runtime->ImportInputs(networkId, {{1, inputTensor2}});
122 CHECK(importedInputVec2.size() == 1);
123 CHECK(importedInputVec2[0] == 1);
125 runtime->Execute(*memHandle.get(), {{0, inputTensor1}}, {{2, outputTensor}}, {1 });
126 for (
auto val: output) {
130 runtime->Execute(*memHandle.get(), {}, {{2, outputTensor}}, {0, 1});
131 for (
auto val: output) {
135 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), {}, {{2, outputTensor}}, {0, 0});,
138 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), {{1, inputTensor2}}, {{2, outputTensor}}, {1});,
141 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), {{1, inputTensor2}}, {{2, outputTensor}}, {10});,
144 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), {{-2, inputTensor2}}, {{2, outputTensor}}, {1});,
147 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), {{-2, inputTensor2}}, {{2, outputTensor}}, {10});,
149 auto importedInputVec3 = runtime->ImportInputs(networkId, {{1, inputTensor2}});
150 CHECK(importedInputVec3[0] == 2);
152 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), {}, {{2, outputTensor}}, {0, 1, 2});,
155 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(),
161 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), {}, {{2, outputTensor}}, {0});,
163 runtime->ClearImportedInputs(networkId, {1});
164 runtime->Execute(*memHandle.get(), {{1, inputTensor2}}, {{2, outputTensor}}, {0}, {});
165 for (
auto val: output) {
169 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), {}, {{2, outputTensor}}, {0, 1}, {});,
178 TEST_CASE(
"RuntimePreImportOutputs")
188 auto inputLayer1 = testNetwork->AddInputLayer(0,
"input 1 layer");
189 inputLayer1->GetOutputSlot(0).SetTensorInfo(tensorInfo);
192 activationDescriptor.
m_Function = ActivationFunction::BoundedReLu;
193 activationDescriptor.
m_A = 2.0f;
194 activationDescriptor.
m_B = 0.0f;
195 auto activationLayer1 = testNetwork->AddActivationLayer(activationDescriptor,
"add layer");
196 auto outputLayer1 = testNetwork->AddOutputLayer(2,
"output layer");
198 inputLayer1->GetOutputSlot(0).Connect(activationLayer1->GetInputSlot(0));
200 activationLayer1->GetOutputSlot(0).Connect(outputLayer1->GetInputSlot(0));
201 activationLayer1->GetOutputSlot(0).SetTensorInfo(tensorInfo);
203 auto inputLayer2 = testNetwork->AddInputLayer(1,
"input 1 layer");
205 activationDescriptor.
m_A = 4.0f;
206 activationDescriptor.
m_B = 2.0f;
207 auto activationLayer2 = testNetwork->AddActivationLayer(activationDescriptor,
"add layer");
208 auto outputLayer2 = testNetwork->AddOutputLayer(3,
"output layer");
210 inputLayer2->GetOutputSlot(0).Connect(activationLayer2->GetInputSlot(0));
211 inputLayer2->GetOutputSlot(0).SetTensorInfo(tensorInfo);
213 activationLayer2->GetOutputSlot(0).Connect(outputLayer2->GetInputSlot(0));
214 activationLayer2->GetOutputSlot(0).SetTensorInfo(tensorInfo);
220 runtime->LoadNetwork(networkId,
221 Optimize(*testNetwork, backends, runtime->GetDeviceSpec()),
225 std::vector<float> inputData1(4, 1.0f);
226 std::vector<float> inputData2(4, 3.0f);
228 std::vector<float> outputData1(4);
229 std::vector<float> outputData2(4);
231 ConstTensor inputTensor1(tensorInfo, inputData1.data());
232 ConstTensor inputTensor2(tensorInfo, inputData2.data());
234 Tensor outputTensor1{tensorInfo, outputData1.data()};
235 Tensor outputTensor2{tensorInfo, outputData2.data()};
237 InputTensors inputTensors = {{0, inputTensor1}, {1, inputTensor2}};
239 std::pair<LayerBindingId, class Tensor> output1{2, outputTensor1};
240 std::pair<LayerBindingId, class Tensor> output2{3, outputTensor2};
242 auto testOutputs = [&]()
244 for (
auto val : outputData1)
249 for (
auto val : outputData2)
255 auto memHandle = runtime->CreateWorkingMemHandle(networkId);
257 runtime->Execute(*memHandle.get(),inputTensors, {output1, output2});
260 auto importedOutputVec = runtime->ImportOutputs(networkId, {output1, output2 });
261 CHECK(importedOutputVec.size() == 2);
262 CHECK(importedOutputVec[0] == 0);
263 CHECK(importedOutputVec[1] == 1);
265 runtime->Execute(*memHandle.get(), inputTensors, {}, {}, importedOutputVec);
268 runtime->Execute(*memHandle.get(), inputTensors, {output1}, {}, {1});
271 runtime->Execute(*memHandle.get(), inputTensors, {output2}, {}, {0});
274 auto importedInputVec = runtime->ImportInputs(networkId, inputTensors);
275 CHECK(importedInputVec.size() == 2);
276 CHECK(importedInputVec[0] == 0);
277 CHECK(importedInputVec[1] == 1);
279 runtime->Execute(*memHandle.get(), {}, {}, importedInputVec, importedOutputVec);
282 runtime->Execute(*memHandle.get(), {{0, inputTensor1}}, {output2}, {1}, {0});
286 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), inputTensors, {output1, output2}, {}, {0, 1});,
290 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), inputTensors, {output2}, {}, {1});,
294 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), inputTensors, {output1, output1}, {}, {});,
298 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), inputTensors, {}, {}, {0, 0}),
302 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), inputTensors, {output1}, {}, {3});,
306 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), inputTensors, {{4, outputTensor2}}, {}, {1});,
310 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), inputTensors, {{0, outputTensor2}}, {}, {1});,
314 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), inputTensors, {{0, outputTensor2}}, {}, {1});,
318 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), {{2, inputTensor1}}, {{0, outputTensor2}}, {1}, {1, 0});,
321 runtime->ClearImportedOutputs(networkId, {1});
323 runtime->Execute(*memHandle.get(), inputTensors, {output2}, {}, {0});
327 CHECK_THROWS_AS(runtime->Execute(*memHandle.get(), inputTensors, {}, {}, importedOutputVec),
342 #ifdef ARMNN_LEAK_CHECKING_ENABLED 344 struct DisableGlobalLeakChecking
346 DisableGlobalLeakChecking()
352 TEST_CASE_FIXTURE(DisableGlobalLeakChecking,
"RuntimeHeapMemoryUsageSanityChecks")
360 std::unique_ptr<char[]> dummyAllocation(
new char[1000]);
373 #endif // ARMNN_LEAK_CHECKING_ENABLED 379 TEST_CASE(
"RuntimeMemoryLeak")
385 unsigned long leakedBefore = 0;
386 unsigned long leakedAfter = 0;
391 unsigned long reachableBefore = 0;
392 unsigned long reachableAfter = 0;
395 unsigned long dubious = 0;
396 unsigned long suppressed = 0;
410 mockNetwork1->AddInputLayer(0,
"test layer");
413 runtime.LoadNetwork(networkIdentifier1,
Optimize(*mockNetwork1, backends, runtime.GetDeviceSpec()));
414 runtime.UnloadNetwork(networkIdentifier1);
417 VALGRIND_DO_QUICK_LEAK_CHECK;
418 VALGRIND_COUNT_LEAKS(leakedBefore, dubious, reachableBefore, suppressed);
421 runtime.LoadNetwork(networkIdentifier1,
Optimize(*mockNetwork1, backends, runtime.GetDeviceSpec()));
422 runtime.UnloadNetwork(networkIdentifier1);
424 VALGRIND_DO_ADDED_LEAK_CHECK;
425 VALGRIND_COUNT_LEAKS(leakedAfter, dubious, reachableAfter, suppressed);
429 CHECK(leakedBefore == leakedAfter);
430 CHECK(reachableBefore == reachableAfter);
437 #endif // WITH_VALGRIND 439 TEST_CASE(
"RuntimeCpuRef")
441 using namespace armnn;
470 CHECK(runtime->LoadNetwork(netId, std::move(optNet)) == Status::Success);
473 TEST_CASE(
"RuntimeFallbackToCpuRef")
475 using namespace armnn;
505 CHECK(runtime->LoadNetwork(netId, std::move(optNet)) == Status::Success);
508 TEST_CASE(
"IVGCVSW_1929_QuantizedSoftmaxIssue")
511 using namespace armnn;
534 std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef };
535 std::vector<std::string> errMessages;
541 runtime->GetDeviceSpec(),
544 FAIL(
"An exception should have been thrown");
550 CHECK(errMessages.size() > 0);
553 TEST_CASE(
"RuntimeBackendOptions")
555 using namespace armnn;
569 options1.
AddOption({
"Option3",
"some_value" });
572 backendOptions.push_back(options1);
581 CHECK(backendOptions[0].
GetBackendId().Get() ==
"FakeBackend1");
582 CHECK(backendOptions[0].GetOption(0).GetName() ==
"Option1");
583 CHECK(backendOptions[0].GetOption(0).GetValue().IsFloat() ==
true);
584 CHECK(backendOptions[0].GetOption(0).GetValue().AsFloat() == 1.3f);
586 CHECK(backendOptions[0].GetOption(1).GetName() ==
"Option2");
587 CHECK(backendOptions[0].GetOption(1).GetValue().IsBool() ==
true);
588 CHECK(backendOptions[0].GetOption(1).GetValue().AsBool() ==
true);
590 CHECK(backendOptions[0].GetOption(2).GetName() ==
"Option3");
591 CHECK(backendOptions[0].GetOption(2).GetValue().IsString() ==
true);
592 CHECK(backendOptions[0].GetOption(2).GetValue().AsString() ==
"some_value");
595 CHECK(backendOptions[1].
GetBackendId().Get() ==
"FakeBackend1");
596 CHECK(backendOptions[1].GetOption(0).GetName() ==
"Option4");
597 CHECK(backendOptions[1].GetOption(0).GetValue().IsInt() ==
true);
598 CHECK(backendOptions[1].GetOption(0).GetValue().AsInt() == 42);
601 TEST_CASE(
"ProfilingDisable")
603 using namespace armnn;
605 LogLevelSwapper logLevelSwapper(arm::pipe::LogSeverity::Fatal);
629 std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef };
634 CHECK(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success);
639 BufferManager& bufferManager = profilingServiceHelper.GetProfilingBufferManager();
640 auto readableBuffer = bufferManager.GetReadableBuffer();
643 CHECK(!readableBuffer);
646 TEST_CASE(
"ProfilingEnableCpuRef")
648 using namespace armnn;
663 profilingServiceHelper.ForceTransitionToState(ProfilingState::NotConnected);
664 profilingServiceHelper.ForceTransitionToState(ProfilingState::WaitingForAck);
665 profilingServiceHelper.ForceTransitionToState(ProfilingState::Active);
673 IConnectableLayer* normalize = net->AddNormalizationLayer(descriptor,
"normalization");
684 std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef };
687 ProfilingGuid optNetGuid = optNet->GetGuid();
691 CHECK(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success);
693 BufferManager& bufferManager = profilingServiceHelper.GetProfilingBufferManager();
694 auto readableBuffer = bufferManager.GetReadableBuffer();
697 CHECK(readableBuffer !=
nullptr);
699 unsigned int size = readableBuffer->GetSize();
701 const unsigned char* readableData = readableBuffer->GetReadableData();
702 CHECK(readableData !=
nullptr);
704 unsigned int offset = 0;
715 arm::pipe::EmptyOptional(),
717 LabelsAndEventClasses::NETWORK_GUID,
718 LabelsAndEventClasses::TYPE_GUID,
724 arm::pipe::EmptyOptional(),
725 arm::pipe::EmptyOptional(),
731 arm::pipe::EmptyOptional(),
734 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
739 int processID = arm::pipe::GetCurrentProcessId();
740 std::stringstream ss;
742 std::string processIdLabel = ss.str();
747 arm::pipe::EmptyOptional(),
749 arm::pipe::EmptyOptional(),
750 LabelsAndEventClasses::PROCESS_ID_GUID,
760 arm::pipe::EmptyOptional(),
"input", readableData, offset);
764 arm::pipe::EmptyOptional(),
767 LabelsAndEventClasses::NAME_GUID,
773 arm::pipe::EmptyOptional(),
775 LabelsAndEventClasses::LAYER_GUID,
776 LabelsAndEventClasses::TYPE_GUID,
782 arm::pipe::EmptyOptional(),
785 LabelsAndEventClasses::CHILD_GUID,
795 arm::pipe::EmptyOptional(),
"normalization", readableData, offset);
799 arm::pipe::EmptyOptional(),
801 normalizationLayerNameGuid,
802 LabelsAndEventClasses::NAME_GUID,
808 arm::pipe::EmptyOptional(),
810 LabelsAndEventClasses::LAYER_GUID,
811 LabelsAndEventClasses::TYPE_GUID,
817 arm::pipe::EmptyOptional(),
820 LabelsAndEventClasses::CHILD_GUID,
826 arm::pipe::EmptyOptional(),
829 LabelsAndEventClasses::CONNECTION_GUID,
836 arm::pipe::EmptyOptional(), readableData, offset);
840 arm::pipe::EmptyOptional(),
841 normalizationWorkloadGuid,
842 LabelsAndEventClasses::WORKLOAD_GUID,
843 LabelsAndEventClasses::TYPE_GUID,
849 arm::pipe::EmptyOptional(),
"CpuRef", readableData, offset);
853 arm::pipe::EmptyOptional(),
854 normalizationWorkloadGuid,
856 LabelsAndEventClasses::BACKENDID_GUID,
862 arm::pipe::EmptyOptional(),
864 normalizationWorkloadGuid,
865 LabelsAndEventClasses::CHILD_GUID,
875 arm::pipe::EmptyOptional(),
"output", readableData, offset);
879 arm::pipe::EmptyOptional(),
882 LabelsAndEventClasses::NAME_GUID,
888 arm::pipe::EmptyOptional(),
890 LabelsAndEventClasses::LAYER_GUID,
891 LabelsAndEventClasses::TYPE_GUID,
897 arm::pipe::EmptyOptional(),
900 LabelsAndEventClasses::CHILD_GUID,
906 arm::pipe::EmptyOptional(),
909 LabelsAndEventClasses::CONNECTION_GUID,
913 bufferManager.MarkRead(readableBuffer);
916 std::vector<float> inputData(16);
917 std::vector<float> outputData(16);
919 TensorInfo inputTensorInfo = runtime.GetInputTensorInfo(netId, 0);
923 {0,
ConstTensor(inputTensorInfo, inputData.data())}
927 {0,
Tensor(runtime.GetOutputTensorInfo(netId, 0), outputData.data())}
931 runtime.EnqueueWorkload(netId, inputTensors, outputTensors);
934 auto inputReadableBuffer = bufferManager.GetReadableBuffer();
935 CHECK(inputReadableBuffer !=
nullptr);
938 auto outputReadableBuffer = bufferManager.GetReadableBuffer();
939 CHECK(outputReadableBuffer !=
nullptr);
942 auto inferenceReadableBuffer = bufferManager.GetReadableBuffer();
943 CHECK(inferenceReadableBuffer !=
nullptr);
946 size = inputReadableBuffer->GetSize();
949 readableData = inputReadableBuffer->GetReadableData();
950 CHECK(readableData !=
nullptr);
960 arm::pipe::EmptyOptional(), readableData, offset);
964 arm::pipe::EmptyOptional(),
966 LabelsAndEventClasses::WORKLOAD_GUID,
967 LabelsAndEventClasses::TYPE_GUID,
973 arm::pipe::EmptyOptional(),
"CpuRef", readableData, offset);
977 arm::pipe::EmptyOptional(),
980 LabelsAndEventClasses::BACKENDID_GUID,
986 arm::pipe::EmptyOptional(),
989 LabelsAndEventClasses::CHILD_GUID,
993 bufferManager.MarkRead(inputReadableBuffer);
996 size = outputReadableBuffer->GetSize();
999 readableData = outputReadableBuffer->GetReadableData();
1000 CHECK(readableData !=
nullptr);
1010 arm::pipe::EmptyOptional(), readableData, offset);
1014 arm::pipe::EmptyOptional(),
1016 LabelsAndEventClasses::WORKLOAD_GUID,
1017 LabelsAndEventClasses::TYPE_GUID,
1026 arm::pipe::EmptyOptional(),
1029 LabelsAndEventClasses::BACKENDID_GUID,
1035 arm::pipe::EmptyOptional(),
1038 LabelsAndEventClasses::CHILD_GUID,
1042 bufferManager.MarkRead(outputReadableBuffer);
1045 size = inferenceReadableBuffer->GetSize();
1046 CHECK(size == 976 + 8 * ThreadIdSize);
1048 readableData = inferenceReadableBuffer->GetReadableData();
1049 CHECK(readableData !=
nullptr);
1059 arm::pipe::EmptyOptional(), readableData, offset);
1063 arm::pipe::EmptyOptional(),
1065 LabelsAndEventClasses::INFERENCE_GUID,
1066 LabelsAndEventClasses::TYPE_GUID,
1072 arm::pipe::EmptyOptional(),
1075 LabelsAndEventClasses::EXECUTION_OF_GUID,
1082 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1086 arm::pipe::EmptyOptional(),
1089 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1097 arm::pipe::EmptyOptional(), readableData, offset);
1101 arm::pipe::EmptyOptional(),
1102 inputWorkloadExecutionGuid,
1103 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1104 LabelsAndEventClasses::TYPE_GUID,
1110 arm::pipe::EmptyOptional(),
1112 inputWorkloadExecutionGuid,
1113 LabelsAndEventClasses::CHILD_GUID,
1119 arm::pipe::EmptyOptional(),
1121 inputWorkloadExecutionGuid,
1122 LabelsAndEventClasses::EXECUTION_OF_GUID,
1129 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1133 arm::pipe::EmptyOptional(),
1134 inputWorkloadExecutionGuid,
1135 inputWorkloadExecutionSOLEventId,
1136 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1143 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1147 arm::pipe::EmptyOptional(),
1148 inputWorkloadExecutionGuid,
1149 inputWorkloadExecutionEOLEventId,
1150 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1157 arm::pipe::EmptyOptional(), readableData, offset);
1161 arm::pipe::EmptyOptional(),
1162 normalizeWorkloadExecutionGuid,
1163 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1164 LabelsAndEventClasses::TYPE_GUID,
1170 arm::pipe::EmptyOptional(),
1172 normalizeWorkloadExecutionGuid,
1173 LabelsAndEventClasses::CHILD_GUID,
1179 arm::pipe::EmptyOptional(),
1180 normalizationWorkloadGuid,
1181 normalizeWorkloadExecutionGuid,
1182 LabelsAndEventClasses::EXECUTION_OF_GUID,
1189 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1193 arm::pipe::EmptyOptional(),
1194 normalizeWorkloadExecutionGuid,
1195 normalizationWorkloadExecutionSOLEventGuid,
1196 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1203 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1207 arm::pipe::EmptyOptional(),
1208 normalizeWorkloadExecutionGuid,
1209 normalizationWorkloadExecutionEOLEventGuid,
1210 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1217 arm::pipe::EmptyOptional(), readableData, offset);
1221 arm::pipe::EmptyOptional(),
1222 outputWorkloadExecutionGuid,
1223 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1224 LabelsAndEventClasses::TYPE_GUID,
1230 arm::pipe::EmptyOptional(),
1232 outputWorkloadExecutionGuid,
1233 LabelsAndEventClasses::CHILD_GUID,
1239 arm::pipe::EmptyOptional(),
1241 outputWorkloadExecutionGuid,
1242 LabelsAndEventClasses::EXECUTION_OF_GUID,
1249 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1253 arm::pipe::EmptyOptional(),
1254 outputWorkloadExecutionGuid,
1255 outputWorkloadExecutionSOLEventGuid,
1256 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1263 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1267 arm::pipe::EmptyOptional(),
1268 outputWorkloadExecutionGuid,
1269 outputWorkloadExecutionEOLEventGuid,
1270 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1277 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1281 arm::pipe::EmptyOptional(),
1283 inferenceEOLEventGuid,
1284 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1288 bufferManager.MarkRead(inferenceReadableBuffer);
1291 TEST_CASE(
"ProfilingPostOptimisationStructureCpuRef")
#define ARMNN_SCOPED_LEAK_CHECKER(TAG)
#define ARMNN_LOCAL_LEAK_CHECKING_ONLY()
static IRuntimePtr Create(const CreationOptions &options)
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId)
CPU Execution: Reference C++ kernels.
ProfilingGuid VerifyTimelineEntityBinaryPacketData(arm::pipe::Optional< ProfilingGuid > guid, const unsigned char *readableData, unsigned int &offset)
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
std::vector< std::pair< LayerBindingId, class ConstTensor > > InputTensors
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
bool m_EnableProfiling
Indicates whether external profiling is enabled or not.
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
#define ARMNN_LEAK_CHECKER_IS_ACTIVE()
A tensor defined by a TensorInfo (shape and data type) and a mutable backing store.
void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relationshipType, arm::pipe::Optional< ProfilingGuid > relationshipGuid, arm::pipe::Optional< ProfilingGuid > headGuid, arm::pipe::Optional< ProfilingGuid > tailGuid, arm::pipe::Optional< ProfilingGuid > attributeGuid, const unsigned char *readableData, unsigned int &offset)
#define ARMNN_OBJECTS_LEAKED_IN_SCOPE()
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
std::vector< BackendOptions > m_BackendOptions
Pass backend specific options.
const char * GetBackendId()
void RuntimeLoadedNetworksReserve(armnn::RuntimeImpl *runtime)
void AddOption(BackendOption &&option)
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.
virtual LayerGuid GetGuid() const =0
Returns the unique id of the layer.
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
ProfilingGuid VerifyTimelineLabelBinaryPacketData(arm::pipe::Optional< ProfilingGuid > guid, const std::string &label, const unsigned char *readableData, unsigned int &offset)
ProfilingOptions ConvertExternalProfilingOptions(const armnn::IRuntime::CreationOptions::ExternalProfilingOptions &options)
ArmNN performs an optimization on each model/network before it gets loaded for execution.
An ActivationDescriptor for the ActivationLayer.
void VerifyTimelineHeaderBinary(const unsigned char *readableData, unsigned int &offset, uint32_t packetDataLength)
Struct for the users to pass backend specific options.
float m_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH, Elu).
CPU Execution: NEON: ArmCompute.
#define ARMNN_NO_LEAKS_IN_SCOPE()
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
void SetConstant(const bool IsConstant=true)
Marks the data corresponding to this tensor info as constant.
bool m_TimelineEnabled
Indicates whether external timeline profiling is enabled or not.
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
A NormalizationDescriptor for the NormalizationLayer.
ExternalProfilingOptions m_ProfilingOptions
arm::pipe::IProfilingService & GetProfilingService(armnn::RuntimeImpl *runtime)
ProfilingGuid VerifyTimelineEventBinaryPacket(arm::pipe::Optional< uint64_t > timestamp, arm::pipe::Optional< int > threadId, arm::pipe::Optional< ProfilingGuid > eventGuid, const unsigned char *readableData, unsigned int &offset)
static INetworkPtr Create(NetworkOptions networkOptions={})
float m_B
Beta lower bound value used by the activation functions. (BoundedReLu, Linear, TanH).
A SoftmaxDescriptor for the SoftmaxLayer.
#define ARMNN_BYTES_LEAKED_IN_SCOPE()
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).