13 #include <client/src/ProfilingService.hpp> 14 #include <client/src/ProfilingUtils.hpp> 16 #include <common/include/Assert.hpp> 17 #include <common/include/LabelsAndEventClasses.hpp> 18 #include <common/include/NumericCast.hpp> 19 #include <common/include/Processes.hpp> 20 #include <common/include/Threads.hpp> 22 #include <TestUtils.hpp> 24 #include <doctest/doctest.h> 28 uint32_t sizeUint32 =
sizeof(uint32_t);
29 uint32_t payloadSize = 0;
36 payloadSize += 13 * 2 * sizeUint32;
38 payloadSize += sizeUint32;
40 uint32_t headerSize = 2 * sizeUint32;
41 uint32_t bodySize = 10 * sizeUint32;
43 return headerSize + bodySize + payloadSize;
48 std::vector<BackendId> suitableBackends;
61 return suitableBackends;
66 unsigned int uint32_t_size =
sizeof(uint32_t);
68 unsigned int remainder = numberOfBytes % uint32_t_size;
74 return numberOfBytes + uint32_t_size - remainder;
79 uint32_t packetDataLength)
81 ARM_PIPE_ASSERT(readableData);
84 unsigned int uint32_t_size =
sizeof(uint32_t);
87 uint32_t timelineBinaryPacketHeaderWord0 = ReadUint32(readableData, offset);
88 uint32_t timelineBinaryPacketFamily = (timelineBinaryPacketHeaderWord0 >> 26) & 0x0000003F;
89 uint32_t timelineBinaryPacketClass = (timelineBinaryPacketHeaderWord0 >> 19) & 0x0000007F;
90 uint32_t timelineBinaryPacketType = (timelineBinaryPacketHeaderWord0 >> 16) & 0x00000007;
91 uint32_t timelineBinaryPacketStreamId = (timelineBinaryPacketHeaderWord0 >> 0) & 0x00000007;
92 CHECK(timelineBinaryPacketFamily == 1);
93 CHECK(timelineBinaryPacketClass == 0);
94 CHECK(timelineBinaryPacketType == 1);
95 CHECK(timelineBinaryPacketStreamId == 0);
96 offset += uint32_t_size;
97 uint32_t timelineBinaryPacketHeaderWord1 = ReadUint32(readableData, offset);
98 uint32_t timelineBinaryPacketSequenceNumber = (timelineBinaryPacketHeaderWord1 >> 24) & 0x00000001;
99 uint32_t timelineBinaryPacketDataLength = (timelineBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF;
100 CHECK(timelineBinaryPacketSequenceNumber == 0);
101 CHECK(timelineBinaryPacketDataLength == packetDataLength);
102 offset += uint32_t_size;
106 const std::string& label,
107 const unsigned char* readableData,
108 unsigned int& offset)
110 ARM_PIPE_ASSERT(readableData);
113 unsigned int uint32_t_size =
sizeof(uint32_t);
114 unsigned int uint64_t_size =
sizeof(uint64_t);
118 uint32_t eventClassDeclId = ReadUint32(readableData, offset);
119 CHECK(eventClassDeclId == 0);
122 offset += uint32_t_size;
123 uint64_t readProfilingGuid = ReadUint64(readableData, offset);
124 if (guid.has_value())
126 CHECK(readProfilingGuid == guid.value());
131 ProfilingService profilingService(arm::pipe::MAX_ARMNN_COUNTER,
133 arm::pipe::ARMNN_SOFTWARE_INFO,
134 arm::pipe::ARMNN_SOFTWARE_VERSION,
135 arm::pipe::ARMNN_HARDWARE_VERSION);
136 CHECK(readProfilingGuid == profilingService.GetStaticId(label));
140 offset += uint64_t_size;
141 uint32_t swTraceLabelLength = ReadUint32(readableData, offset);
142 CHECK(swTraceLabelLength == label_size + 1);
143 offset += uint32_t_size;
144 CHECK(std::memcmp(readableData + offset,
146 swTraceLabelLength - 1) == 0);
151 ProfilingGuid labelGuid(readProfilingGuid);
156 ProfilingGuid nameGuid,
157 const unsigned char* readableData,
158 unsigned int& offset)
160 ARM_PIPE_ASSERT(readableData);
163 unsigned int uint32_t_size =
sizeof(uint32_t);
164 unsigned int uint64_t_size =
sizeof(uint64_t);
167 uint32_t eventClassDeclId = ReadUint32(readableData, offset);
168 CHECK(eventClassDeclId == 2);
171 offset += uint32_t_size;
172 uint64_t readProfilingGuid = ReadUint64(readableData, offset);
173 CHECK(readProfilingGuid == guid);
175 offset += uint64_t_size;
176 uint64_t readProfiilngNameGuid = ReadUint64(readableData, offset);
177 CHECK(readProfiilngNameGuid == nameGuid);
180 offset += uint64_t_size;
184 arm::pipe::Optional<ProfilingGuid> relationshipGuid,
185 arm::pipe::Optional<ProfilingGuid> headGuid,
186 arm::pipe::Optional<ProfilingGuid> tailGuid,
187 arm::pipe::Optional<ProfilingGuid> attributeGuid,
188 const unsigned char* readableData,
189 unsigned int& offset)
191 ARM_PIPE_ASSERT(readableData);
193 uint32_t relationshipTypeUint = 0;
194 switch (relationshipType)
196 case ProfilingRelationshipType::RetentionLink:
197 relationshipTypeUint = 0;
199 case ProfilingRelationshipType::ExecutionLink:
200 relationshipTypeUint = 1;
202 case ProfilingRelationshipType::DataLink:
203 relationshipTypeUint = 2;
205 case ProfilingRelationshipType::LabelLink:
206 relationshipTypeUint = 3;
209 FAIL(
"Unknown relationship type");
213 unsigned int uint32_t_size =
sizeof(uint32_t);
214 unsigned int uint64_t_size =
sizeof(uint64_t);
217 uint32_t eventClassDeclId = ReadUint32(readableData, offset);
218 CHECK(eventClassDeclId == 3);
221 offset += uint32_t_size;
222 uint32_t readRelationshipTypeUint = ReadUint32(readableData, offset);
223 CHECK(readRelationshipTypeUint == relationshipTypeUint);
226 offset += uint32_t_size;
227 uint64_t readRelationshipGuid = ReadUint64(readableData, offset);
228 if (relationshipGuid.has_value())
230 CHECK(readRelationshipGuid == relationshipGuid.value());
234 CHECK(readRelationshipGuid != ProfilingGuid(0));
238 offset += uint64_t_size;
239 uint64_t readHeadRelationshipGuid = ReadUint64(readableData, offset);
240 if (headGuid.has_value())
242 CHECK(readHeadRelationshipGuid == headGuid.value());
246 CHECK(readHeadRelationshipGuid != ProfilingGuid(0));
250 offset += uint64_t_size;
251 uint64_t readTailRelationshipGuid = ReadUint64(readableData, offset);
252 if (tailGuid.has_value())
254 CHECK(readTailRelationshipGuid == tailGuid.value());
258 CHECK(readTailRelationshipGuid != ProfilingGuid(0));
262 offset += uint64_t_size;
263 uint64_t readAttributeRelationshipGuid = ReadUint64(readableData, offset);
264 if (attributeGuid.has_value())
266 CHECK(readAttributeRelationshipGuid == attributeGuid.value());
270 CHECK(readAttributeRelationshipGuid == ProfilingGuid(0));
274 offset += uint64_t_size;
278 const unsigned char* readableData,
279 unsigned int& offset)
281 ARM_PIPE_ASSERT(readableData);
284 unsigned int uint32_t_size =
sizeof(uint32_t);
285 unsigned int uint64_t_size =
sizeof(uint64_t);
289 uint32_t entityDeclId = ReadUint32(readableData, offset);
290 CHECK(entityDeclId == 1);
293 offset += uint32_t_size;
294 uint64_t readProfilingGuid = ReadUint64(readableData, offset);
296 if (guid.has_value())
298 CHECK(readProfilingGuid == guid.value());
302 CHECK(readProfilingGuid != ProfilingGuid(0));
305 offset += uint64_t_size;
307 ProfilingGuid entityGuid(readProfilingGuid);
312 arm::pipe::Optional<int> threadId,
313 arm::pipe::Optional<ProfilingGuid> eventGuid,
314 const unsigned char* readableData,
315 unsigned int& offset)
317 ARM_PIPE_ASSERT(readableData);
320 unsigned int uint32_t_size =
sizeof(uint32_t);
321 unsigned int uint64_t_size =
sizeof(uint64_t);
325 uint32_t entityDeclId = ReadUint32(readableData, offset);
326 CHECK(entityDeclId == 4);
329 offset += uint32_t_size;
330 uint64_t readTimestamp = ReadUint64(readableData, offset);
331 if (timestamp.has_value())
333 CHECK(readTimestamp == timestamp.value());
337 CHECK(readTimestamp != 0);
341 offset += uint64_t_size;
342 std::vector<uint8_t> readThreadId(ThreadIdSize, 0);
343 ReadBytes(readableData, offset, ThreadIdSize, readThreadId.data());
344 if (threadId.has_value())
346 CHECK(readThreadId == threadId.value());
350 CHECK(readThreadId == arm::pipe::GetCurrentThreadId());
354 offset += ThreadIdSize;
355 uint64_t readEventGuid = ReadUint64(readableData, offset);
356 if (eventGuid.has_value())
358 CHECK(readEventGuid == eventGuid.value());
362 CHECK(readEventGuid != ProfilingGuid(0));
365 offset += uint64_t_size;
367 ProfilingGuid eventid(readEventGuid);
373 using namespace armnn;
398 std::vector<float> weightsData{
411 std::vector<float> biasesData{ 1.0f, 0.0f, 0.0f };
428 IConnectableLayer* conv2d = net->AddConvolution2dLayer(conv2dDesc, weights, optionalBiases);
437 input->GetOutputSlot(0).Connect(conv2d->GetInputSlot(0));
441 input->GetOutputSlot(0).SetTensorInfo(inputInfo);
442 conv2d->GetOutputSlot(0).SetTensorInfo(outputInfo);
446 std::vector<armnn::BackendId> backends = { backendId };
449 ProfilingGuid optNetGuid = optNet->GetGuid();
456 auto readableBuffer = bufferManager.GetReadableBuffer();
459 CHECK(readableBuffer !=
nullptr);
460 unsigned int size = readableBuffer->GetSize();
462 const unsigned char* readableData = readableBuffer->GetReadableData();
463 CHECK(readableData !=
nullptr);
465 unsigned int offset = 0;
476 arm::pipe::EmptyOptional(),
478 LabelsAndEventClasses::NETWORK_GUID,
479 LabelsAndEventClasses::TYPE_GUID,
485 arm::pipe::EmptyOptional(),
486 arm::pipe::EmptyOptional(),
492 arm::pipe::EmptyOptional(),
495 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
500 int processID = arm::pipe::GetCurrentProcessId();
501 std::stringstream ss;
503 std::string processIdLabel = ss.str();
505 arm::pipe::EmptyOptional(), processIdLabel, readableData, offset);
509 arm::pipe::EmptyOptional(),
511 arm::pipe::EmptyOptional(),
512 LabelsAndEventClasses::PROCESS_ID_GUID,
521 arm::pipe::EmptyOptional(),
"input", readableData, offset);
525 arm::pipe::EmptyOptional(),
528 LabelsAndEventClasses::NAME_GUID,
534 arm::pipe::EmptyOptional(),
536 LabelsAndEventClasses::LAYER_GUID,
537 LabelsAndEventClasses::TYPE_GUID,
543 arm::pipe::EmptyOptional(),
546 LabelsAndEventClasses::CHILD_GUID,
561 arm::pipe::EmptyOptional(),
"Weights", readableData, offset);
565 arm::pipe::EmptyOptional(),
566 arm::pipe::EmptyOptional(),
567 weightsNameLabelGuid,
568 LabelsAndEventClasses::NAME_GUID,
574 arm::pipe::EmptyOptional(),
575 arm::pipe::EmptyOptional(),
576 LabelsAndEventClasses::LAYER_GUID,
577 LabelsAndEventClasses::TYPE_GUID,
583 arm::pipe::EmptyOptional(),
585 arm::pipe::EmptyOptional(),
586 LabelsAndEventClasses::CHILD_GUID,
593 arm::pipe::EmptyOptional(), readableData, offset);
597 arm::pipe::EmptyOptional(),
599 LabelsAndEventClasses::WORKLOAD_GUID,
600 LabelsAndEventClasses::TYPE_GUID,
606 arm::pipe::EmptyOptional(), backendId.
Get(), readableData, offset);
610 arm::pipe::EmptyOptional(),
613 LabelsAndEventClasses::BACKENDID_GUID,
620 arm::pipe::EmptyOptional(),
621 arm::pipe::EmptyOptional(),
623 LabelsAndEventClasses::CHILD_GUID,
637 arm::pipe::EmptyOptional(),
"Bias", readableData, offset);
641 arm::pipe::EmptyOptional(),
642 arm::pipe::EmptyOptional(),
644 LabelsAndEventClasses::NAME_GUID,
650 arm::pipe::EmptyOptional(),
651 arm::pipe::EmptyOptional(),
652 LabelsAndEventClasses::LAYER_GUID,
653 LabelsAndEventClasses::TYPE_GUID,
659 arm::pipe::EmptyOptional(),
661 arm::pipe::EmptyOptional(),
662 LabelsAndEventClasses::CHILD_GUID,
669 arm::pipe::EmptyOptional(), readableData, offset);
673 arm::pipe::EmptyOptional(),
675 LabelsAndEventClasses::WORKLOAD_GUID,
676 LabelsAndEventClasses::TYPE_GUID,
682 arm::pipe::EmptyOptional(), backendId.
Get(), readableData, offset);
686 arm::pipe::EmptyOptional(),
689 LabelsAndEventClasses::BACKENDID_GUID,
696 arm::pipe::EmptyOptional(),
697 arm::pipe::EmptyOptional(),
699 LabelsAndEventClasses::CHILD_GUID,
709 arm::pipe::EmptyOptional(),
"<Unnamed>", readableData, offset);
713 arm::pipe::EmptyOptional(),
716 LabelsAndEventClasses::NAME_GUID,
722 arm::pipe::EmptyOptional(),
724 LabelsAndEventClasses::LAYER_GUID,
725 LabelsAndEventClasses::TYPE_GUID,
731 arm::pipe::EmptyOptional(),
734 LabelsAndEventClasses::CHILD_GUID,
740 arm::pipe::EmptyOptional(),
743 LabelsAndEventClasses::CONNECTION_GUID,
749 arm::pipe::EmptyOptional(),
750 arm::pipe::EmptyOptional(),
752 LabelsAndEventClasses::CONNECTION_GUID,
758 arm::pipe::EmptyOptional(),
759 arm::pipe::EmptyOptional(),
761 LabelsAndEventClasses::CONNECTION_GUID,
768 arm::pipe::EmptyOptional(), readableData, offset);
772 arm::pipe::EmptyOptional(),
774 LabelsAndEventClasses::WORKLOAD_GUID,
775 LabelsAndEventClasses::TYPE_GUID,
781 arm::pipe::EmptyOptional(), backendId.
Get(), readableData, offset);
785 arm::pipe::EmptyOptional(),
788 LabelsAndEventClasses::BACKENDID_GUID,
795 arm::pipe::EmptyOptional(),
798 LabelsAndEventClasses::CHILD_GUID,
808 arm::pipe::EmptyOptional(),
"abs", readableData, offset);
812 arm::pipe::EmptyOptional(),
815 LabelsAndEventClasses::NAME_GUID,
821 arm::pipe::EmptyOptional(),
823 LabelsAndEventClasses::LAYER_GUID,
824 LabelsAndEventClasses::TYPE_GUID,
830 arm::pipe::EmptyOptional(),
833 LabelsAndEventClasses::CHILD_GUID,
839 arm::pipe::EmptyOptional(),
842 LabelsAndEventClasses::CONNECTION_GUID,
849 arm::pipe::EmptyOptional(), readableData, offset);
853 arm::pipe::EmptyOptional(),
855 LabelsAndEventClasses::WORKLOAD_GUID,
856 LabelsAndEventClasses::TYPE_GUID,
865 arm::pipe::EmptyOptional(),
868 LabelsAndEventClasses::BACKENDID_GUID,
874 arm::pipe::EmptyOptional(),
877 LabelsAndEventClasses::CHILD_GUID,
887 arm::pipe::EmptyOptional(),
"output", readableData, offset);
891 arm::pipe::EmptyOptional(),
894 LabelsAndEventClasses::NAME_GUID,
900 arm::pipe::EmptyOptional(),
902 LabelsAndEventClasses::LAYER_GUID,
903 LabelsAndEventClasses::TYPE_GUID,
909 arm::pipe::EmptyOptional(),
912 LabelsAndEventClasses::CHILD_GUID,
918 arm::pipe::EmptyOptional(),
921 LabelsAndEventClasses::CONNECTION_GUID,
925 bufferManager.MarkRead(readableBuffer);
928 std::vector<float> inputData(inputInfo.GetNumElements());
929 std::vector<float> outputData(outputInfo.GetNumElements());
935 {0,
ConstTensor(inputTensorInfo, inputData.data())}
946 auto inputReadableBuffer = bufferManager.GetReadableBuffer();
947 CHECK(inputReadableBuffer !=
nullptr);
950 auto outputReadableBuffer = bufferManager.GetReadableBuffer();
951 CHECK(outputReadableBuffer !=
nullptr);
954 auto inferenceReadableBuffer = bufferManager.GetReadableBuffer();
955 CHECK(inferenceReadableBuffer !=
nullptr);
958 size = inputReadableBuffer->GetSize();
961 readableData = inputReadableBuffer->GetReadableData();
962 CHECK(readableData !=
nullptr);
972 arm::pipe::EmptyOptional(), readableData, offset);
976 arm::pipe::EmptyOptional(),
978 LabelsAndEventClasses::WORKLOAD_GUID,
979 LabelsAndEventClasses::TYPE_GUID,
988 arm::pipe::EmptyOptional(),
991 LabelsAndEventClasses::BACKENDID_GUID,
997 arm::pipe::EmptyOptional(),
1000 LabelsAndEventClasses::CHILD_GUID,
1004 bufferManager.MarkRead(inputReadableBuffer);
1007 size = outputReadableBuffer->GetSize();
1010 readableData = outputReadableBuffer->GetReadableData();
1011 CHECK(readableData !=
nullptr);
1021 arm::pipe::EmptyOptional(), readableData, offset);
1025 arm::pipe::EmptyOptional(),
1027 LabelsAndEventClasses::WORKLOAD_GUID,
1028 LabelsAndEventClasses::TYPE_GUID,
1037 arm::pipe::EmptyOptional(),
1040 LabelsAndEventClasses::BACKENDID_GUID,
1046 arm::pipe::EmptyOptional(),
1049 LabelsAndEventClasses::CHILD_GUID,
1053 bufferManager.MarkRead(outputReadableBuffer);
1056 size = inferenceReadableBuffer->GetSize();
1058 CHECK(size == 1748 + 10 * ThreadIdSize);
1060 readableData = inferenceReadableBuffer->GetReadableData();
1061 CHECK(readableData !=
nullptr);
1071 arm::pipe::EmptyOptional(), readableData, offset);
1075 arm::pipe::EmptyOptional(),
1077 LabelsAndEventClasses::INFERENCE_GUID,
1078 LabelsAndEventClasses::TYPE_GUID,
1084 arm::pipe::EmptyOptional(),
1087 LabelsAndEventClasses::EXECUTION_OF_GUID,
1094 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1098 arm::pipe::EmptyOptional(),
1101 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1109 arm::pipe::EmptyOptional(), readableData, offset);
1113 arm::pipe::EmptyOptional(),
1114 inputWorkloadExecutionGuid,
1115 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1116 LabelsAndEventClasses::TYPE_GUID,
1122 arm::pipe::EmptyOptional(),
1124 inputWorkloadExecutionGuid,
1125 LabelsAndEventClasses::CHILD_GUID,
1131 arm::pipe::EmptyOptional(),
1133 inputWorkloadExecutionGuid,
1134 LabelsAndEventClasses::EXECUTION_OF_GUID,
1141 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1145 arm::pipe::EmptyOptional(),
1146 inputWorkloadExecutionGuid,
1147 inputWorkloadExecutionSOLEventId,
1148 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1155 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1159 arm::pipe::EmptyOptional(),
1160 inputWorkloadExecutionGuid,
1161 inputWorkloadExecutionEOLEventId,
1162 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1169 arm::pipe::EmptyOptional(), readableData, offset);
1173 arm::pipe::EmptyOptional(),
1174 weightsWorkloadExecutionGuid,
1175 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1176 LabelsAndEventClasses::TYPE_GUID,
1182 arm::pipe::EmptyOptional(),
1184 weightsWorkloadExecutionGuid,
1185 LabelsAndEventClasses::CHILD_GUID,
1191 arm::pipe::EmptyOptional(),
1192 weightsWorkloadGuid,
1193 weightsWorkloadExecutionGuid,
1194 LabelsAndEventClasses::EXECUTION_OF_GUID,
1201 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1205 arm::pipe::EmptyOptional(),
1206 weightsWorkloadExecutionGuid,
1207 weightsWorkloadExecutionSOLEventGuid,
1208 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1215 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1219 arm::pipe::EmptyOptional(),
1220 weightsWorkloadExecutionGuid,
1221 weightsWorkloadExecutionEOLEventGuid,
1222 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1229 arm::pipe::EmptyOptional(), readableData, offset);
1233 arm::pipe::EmptyOptional(),
1234 biasWorkloadExecutionGuid,
1235 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1236 LabelsAndEventClasses::TYPE_GUID,
1242 arm::pipe::EmptyOptional(),
1244 biasWorkloadExecutionGuid,
1245 LabelsAndEventClasses::CHILD_GUID,
1251 arm::pipe::EmptyOptional(),
1253 biasWorkloadExecutionGuid,
1254 LabelsAndEventClasses::EXECUTION_OF_GUID,
1261 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1265 arm::pipe::EmptyOptional(),
1266 biasWorkloadExecutionGuid,
1267 biasWorkloadExecutionSOLEventGuid,
1268 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1275 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1279 arm::pipe::EmptyOptional(),
1280 biasWorkloadExecutionGuid,
1281 biasWorkloadExecutionEOLEventGuid,
1282 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1289 arm::pipe::EmptyOptional(), readableData, offset);
1293 arm::pipe::EmptyOptional(),
1294 conv2DWorkloadExecutionGuid,
1295 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1296 LabelsAndEventClasses::TYPE_GUID,
1302 arm::pipe::EmptyOptional(),
1304 conv2DWorkloadExecutionGuid,
1305 LabelsAndEventClasses::CHILD_GUID,
1311 arm::pipe::EmptyOptional(),
1313 conv2DWorkloadExecutionGuid,
1314 LabelsAndEventClasses::EXECUTION_OF_GUID,
1321 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1325 arm::pipe::EmptyOptional(),
1326 conv2DWorkloadExecutionGuid,
1327 conv2DWorkloadExecutionSOLEventGuid,
1328 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1335 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1339 arm::pipe::EmptyOptional(),
1340 conv2DWorkloadExecutionGuid,
1341 conv2DWorkloadExecutionEOLEventGuid,
1342 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1349 arm::pipe::EmptyOptional(), readableData, offset);
1353 arm::pipe::EmptyOptional(),
1354 absWorkloadExecutionGuid,
1355 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1356 LabelsAndEventClasses::TYPE_GUID,
1362 arm::pipe::EmptyOptional(),
1364 absWorkloadExecutionGuid,
1365 LabelsAndEventClasses::CHILD_GUID,
1371 arm::pipe::EmptyOptional(),
1373 absWorkloadExecutionGuid,
1374 LabelsAndEventClasses::EXECUTION_OF_GUID,
1381 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1385 arm::pipe::EmptyOptional(),
1386 absWorkloadExecutionGuid,
1387 absWorkloadExecutionSOLEventGuid,
1388 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1395 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1399 arm::pipe::EmptyOptional(),
1400 absWorkloadExecutionGuid,
1401 absWorkloadExecutionEOLEventGuid,
1402 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1409 arm::pipe::EmptyOptional(), readableData, offset);
1413 arm::pipe::EmptyOptional(),
1414 outputWorkloadExecutionGuid,
1415 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1416 LabelsAndEventClasses::TYPE_GUID,
1422 arm::pipe::EmptyOptional(),
1424 outputWorkloadExecutionGuid,
1425 LabelsAndEventClasses::CHILD_GUID,
1431 arm::pipe::EmptyOptional(),
1433 outputWorkloadExecutionGuid,
1434 LabelsAndEventClasses::EXECUTION_OF_GUID,
1441 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1445 arm::pipe::EmptyOptional(),
1446 outputWorkloadExecutionGuid,
1447 outputWorkloadExecutionSOLEventGuid,
1448 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1455 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1459 arm::pipe::EmptyOptional(),
1460 outputWorkloadExecutionGuid,
1461 outputWorkloadExecutionEOLEventGuid,
1462 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1469 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1473 arm::pipe::EmptyOptional(),
1475 inferenceEOLEventGuid,
1476 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1480 bufferManager.MarkRead(inferenceReadableBuffer);
1483 bool CompareOutput(std::vector<std::string> output, std::vector<std::string> expectedOutput)
1485 if (output.size() != expectedOutput.size())
1487 std::cerr <<
"output has [" << output.size() <<
"] lines, expected was [" 1488 << expectedOutput.size() <<
"] lines" << std::endl;
1489 std::cerr << std::endl <<
"actual" << std::endl << std::endl;
1490 for (
auto line : output)
1492 std::cerr << line << std::endl;
1494 std::cerr << std::endl <<
"expected" << std::endl << std::endl;
1495 for (
auto line : expectedOutput)
1497 std::cerr << line << std::endl;
1502 for (
unsigned long i = 0; i < output.size(); ++i)
1504 if (output[i] != expectedOutput[i])
1507 std::cerr << i <<
": actual [" << output[i] <<
"] expected [" << expectedOutput[i] <<
"]" << std::endl;
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
armnn::TensorInfo GetInputTensorInfo(NetworkId networkId, LayerBindingId layerId) const
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, ProfilingGuid nameGuid, const unsigned char *readableData, unsigned int &offset)
BufferManager & GetProfilingBufferManager()
void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId)
CPU Execution: Reference C++ kernels.
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
A Convolution2dDescriptor for the Convolution2dLayer.
uint32_t GetStreamMetaDataPacketSize()
ProfilingGuid VerifyTimelineEntityBinaryPacketData(arm::pipe::Optional< ProfilingGuid > guid, const unsigned char *readableData, unsigned int &offset)
BackendRegistry & BackendRegistryInstance()
Status LoadNetwork(NetworkId &networkIdOut, IOptimizedNetworkPtr network)
Loads a complete network into the Runtime.
std::vector< std::pair< LayerBindingId, class ConstTensor > > InputTensors
uint32_t m_PadRight
Padding right value in the width dimension.
armnn::TensorInfo GetOutputTensorInfo(NetworkId networkId, LayerBindingId layerId) const
Copyright (c) 2021 ARM Limited and Contributors.
std::vector< BackendId > GetSuitableBackendRegistered()
Returns a vector of CpuRef, CpuAcc or GpuAcc backends if they where registered.
bool m_EnableProfiling
Indicates whether external profiling is enabled or not.
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
A tensor defined by a TensorInfo (shape and data type) and a mutable backing store.
unsigned int OffsetToNextWord(unsigned int numberOfBytes)
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)
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
#define ARMNN_NO_DEPRECATE_WARN_END
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
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)
constexpr char const * GetComputeDeviceAsCString(Compute compute)
Deprecated function that will be removed together with the Compute enum.
GPU Execution: OpenCL: ArmCompute.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
void VerifyTimelineHeaderBinary(const unsigned char *readableData, unsigned int &offset, uint32_t packetDataLength)
Status EnqueueWorkload(NetworkId networkId, const InputTensors &inputTensors, const OutputTensors &outputTensors, std::vector< ImportedInputId > preImportedInputIds={}, std::vector< ImportedOutputId > preImportedOutputIds={})
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
void ForceTransitionToState(ProfilingState newState)
CPU Execution: NEON: ArmCompute.
const std::string & Get() const
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.
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
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
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={})
uint32_t m_PadLeft
Padding left value in the width dimension.