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 };
446 input->GetOutputSlot(0).Connect(conv2d->
GetInputSlot(0));
450 input->GetOutputSlot(0).SetTensorInfo(inputInfo);
455 std::vector<armnn::BackendId> backends = { backendId };
458 ProfilingGuid optNetGuid = optNet->GetGuid();
465 auto readableBuffer = bufferManager.GetReadableBuffer();
468 CHECK(readableBuffer !=
nullptr);
469 unsigned int size = readableBuffer->GetSize();
471 const unsigned char* readableData = readableBuffer->GetReadableData();
472 CHECK(readableData !=
nullptr);
474 unsigned int offset = 0;
485 arm::pipe::EmptyOptional(),
487 LabelsAndEventClasses::NETWORK_GUID,
488 LabelsAndEventClasses::TYPE_GUID,
494 arm::pipe::EmptyOptional(),
495 arm::pipe::EmptyOptional(),
501 arm::pipe::EmptyOptional(),
504 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
509 int processID = arm::pipe::GetCurrentProcessId();
510 std::stringstream ss;
512 std::string processIdLabel = ss.str();
514 arm::pipe::EmptyOptional(), processIdLabel, readableData, offset);
518 arm::pipe::EmptyOptional(),
520 arm::pipe::EmptyOptional(),
521 LabelsAndEventClasses::PROCESS_ID_GUID,
530 arm::pipe::EmptyOptional(),
"input", readableData, offset);
534 arm::pipe::EmptyOptional(),
537 LabelsAndEventClasses::NAME_GUID,
543 arm::pipe::EmptyOptional(),
545 LabelsAndEventClasses::LAYER_GUID,
546 LabelsAndEventClasses::TYPE_GUID,
552 arm::pipe::EmptyOptional(),
555 LabelsAndEventClasses::CHILD_GUID,
570 arm::pipe::EmptyOptional(),
"Weights", readableData, offset);
574 arm::pipe::EmptyOptional(),
575 arm::pipe::EmptyOptional(),
576 weightsNameLabelGuid,
577 LabelsAndEventClasses::NAME_GUID,
583 arm::pipe::EmptyOptional(),
584 arm::pipe::EmptyOptional(),
585 LabelsAndEventClasses::LAYER_GUID,
586 LabelsAndEventClasses::TYPE_GUID,
592 arm::pipe::EmptyOptional(),
594 arm::pipe::EmptyOptional(),
595 LabelsAndEventClasses::CHILD_GUID,
602 arm::pipe::EmptyOptional(), readableData, offset);
606 arm::pipe::EmptyOptional(),
608 LabelsAndEventClasses::WORKLOAD_GUID,
609 LabelsAndEventClasses::TYPE_GUID,
615 arm::pipe::EmptyOptional(), backendId.
Get(), readableData, offset);
619 arm::pipe::EmptyOptional(),
622 LabelsAndEventClasses::BACKENDID_GUID,
629 arm::pipe::EmptyOptional(),
630 arm::pipe::EmptyOptional(),
632 LabelsAndEventClasses::CHILD_GUID,
646 arm::pipe::EmptyOptional(),
"Bias", readableData, offset);
650 arm::pipe::EmptyOptional(),
651 arm::pipe::EmptyOptional(),
653 LabelsAndEventClasses::NAME_GUID,
659 arm::pipe::EmptyOptional(),
660 arm::pipe::EmptyOptional(),
661 LabelsAndEventClasses::LAYER_GUID,
662 LabelsAndEventClasses::TYPE_GUID,
668 arm::pipe::EmptyOptional(),
670 arm::pipe::EmptyOptional(),
671 LabelsAndEventClasses::CHILD_GUID,
678 arm::pipe::EmptyOptional(), readableData, offset);
682 arm::pipe::EmptyOptional(),
684 LabelsAndEventClasses::WORKLOAD_GUID,
685 LabelsAndEventClasses::TYPE_GUID,
691 arm::pipe::EmptyOptional(), backendId.
Get(), readableData, offset);
695 arm::pipe::EmptyOptional(),
698 LabelsAndEventClasses::BACKENDID_GUID,
705 arm::pipe::EmptyOptional(),
706 arm::pipe::EmptyOptional(),
708 LabelsAndEventClasses::CHILD_GUID,
718 arm::pipe::EmptyOptional(),
"<Unnamed>", readableData, offset);
722 arm::pipe::EmptyOptional(),
725 LabelsAndEventClasses::NAME_GUID,
731 arm::pipe::EmptyOptional(),
733 LabelsAndEventClasses::LAYER_GUID,
734 LabelsAndEventClasses::TYPE_GUID,
740 arm::pipe::EmptyOptional(),
743 LabelsAndEventClasses::CHILD_GUID,
749 arm::pipe::EmptyOptional(),
752 LabelsAndEventClasses::CONNECTION_GUID,
758 arm::pipe::EmptyOptional(),
759 arm::pipe::EmptyOptional(),
761 LabelsAndEventClasses::CONNECTION_GUID,
767 arm::pipe::EmptyOptional(),
768 arm::pipe::EmptyOptional(),
770 LabelsAndEventClasses::CONNECTION_GUID,
777 arm::pipe::EmptyOptional(), readableData, offset);
781 arm::pipe::EmptyOptional(),
783 LabelsAndEventClasses::WORKLOAD_GUID,
784 LabelsAndEventClasses::TYPE_GUID,
790 arm::pipe::EmptyOptional(), backendId.
Get(), readableData, offset);
794 arm::pipe::EmptyOptional(),
797 LabelsAndEventClasses::BACKENDID_GUID,
804 arm::pipe::EmptyOptional(),
807 LabelsAndEventClasses::CHILD_GUID,
817 arm::pipe::EmptyOptional(),
"abs", readableData, offset);
821 arm::pipe::EmptyOptional(),
824 LabelsAndEventClasses::NAME_GUID,
830 arm::pipe::EmptyOptional(),
832 LabelsAndEventClasses::LAYER_GUID,
833 LabelsAndEventClasses::TYPE_GUID,
839 arm::pipe::EmptyOptional(),
842 LabelsAndEventClasses::CHILD_GUID,
848 arm::pipe::EmptyOptional(),
851 LabelsAndEventClasses::CONNECTION_GUID,
858 arm::pipe::EmptyOptional(), readableData, offset);
862 arm::pipe::EmptyOptional(),
864 LabelsAndEventClasses::WORKLOAD_GUID,
865 LabelsAndEventClasses::TYPE_GUID,
874 arm::pipe::EmptyOptional(),
877 LabelsAndEventClasses::BACKENDID_GUID,
883 arm::pipe::EmptyOptional(),
886 LabelsAndEventClasses::CHILD_GUID,
896 arm::pipe::EmptyOptional(),
"output", readableData, offset);
900 arm::pipe::EmptyOptional(),
903 LabelsAndEventClasses::NAME_GUID,
909 arm::pipe::EmptyOptional(),
911 LabelsAndEventClasses::LAYER_GUID,
912 LabelsAndEventClasses::TYPE_GUID,
918 arm::pipe::EmptyOptional(),
921 LabelsAndEventClasses::CHILD_GUID,
927 arm::pipe::EmptyOptional(),
930 LabelsAndEventClasses::CONNECTION_GUID,
934 bufferManager.MarkRead(readableBuffer);
937 std::vector<float> inputData(inputInfo.GetNumElements());
938 std::vector<float> outputData(outputInfo.GetNumElements());
944 {0,
ConstTensor(inputTensorInfo, inputData.data())}
955 auto inputReadableBuffer = bufferManager.GetReadableBuffer();
956 CHECK(inputReadableBuffer !=
nullptr);
959 auto outputReadableBuffer = bufferManager.GetReadableBuffer();
960 CHECK(outputReadableBuffer !=
nullptr);
963 auto inferenceReadableBuffer = bufferManager.GetReadableBuffer();
964 CHECK(inferenceReadableBuffer !=
nullptr);
967 size = inputReadableBuffer->GetSize();
970 readableData = inputReadableBuffer->GetReadableData();
971 CHECK(readableData !=
nullptr);
981 arm::pipe::EmptyOptional(), readableData, offset);
985 arm::pipe::EmptyOptional(),
987 LabelsAndEventClasses::WORKLOAD_GUID,
988 LabelsAndEventClasses::TYPE_GUID,
997 arm::pipe::EmptyOptional(),
1000 LabelsAndEventClasses::BACKENDID_GUID,
1006 arm::pipe::EmptyOptional(),
1009 LabelsAndEventClasses::CHILD_GUID,
1013 bufferManager.MarkRead(inputReadableBuffer);
1016 size = outputReadableBuffer->GetSize();
1019 readableData = outputReadableBuffer->GetReadableData();
1020 CHECK(readableData !=
nullptr);
1030 arm::pipe::EmptyOptional(), readableData, offset);
1034 arm::pipe::EmptyOptional(),
1036 LabelsAndEventClasses::WORKLOAD_GUID,
1037 LabelsAndEventClasses::TYPE_GUID,
1046 arm::pipe::EmptyOptional(),
1049 LabelsAndEventClasses::BACKENDID_GUID,
1055 arm::pipe::EmptyOptional(),
1058 LabelsAndEventClasses::CHILD_GUID,
1062 bufferManager.MarkRead(outputReadableBuffer);
1065 size = inferenceReadableBuffer->GetSize();
1067 CHECK(size == 1748 + 10 * ThreadIdSize);
1069 readableData = inferenceReadableBuffer->GetReadableData();
1070 CHECK(readableData !=
nullptr);
1080 arm::pipe::EmptyOptional(), readableData, offset);
1084 arm::pipe::EmptyOptional(),
1086 LabelsAndEventClasses::INFERENCE_GUID,
1087 LabelsAndEventClasses::TYPE_GUID,
1093 arm::pipe::EmptyOptional(),
1096 LabelsAndEventClasses::EXECUTION_OF_GUID,
1103 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1107 arm::pipe::EmptyOptional(),
1110 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1118 arm::pipe::EmptyOptional(), readableData, offset);
1122 arm::pipe::EmptyOptional(),
1123 inputWorkloadExecutionGuid,
1124 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1125 LabelsAndEventClasses::TYPE_GUID,
1131 arm::pipe::EmptyOptional(),
1133 inputWorkloadExecutionGuid,
1134 LabelsAndEventClasses::CHILD_GUID,
1140 arm::pipe::EmptyOptional(),
1142 inputWorkloadExecutionGuid,
1143 LabelsAndEventClasses::EXECUTION_OF_GUID,
1150 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1154 arm::pipe::EmptyOptional(),
1155 inputWorkloadExecutionGuid,
1156 inputWorkloadExecutionSOLEventId,
1157 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1164 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1168 arm::pipe::EmptyOptional(),
1169 inputWorkloadExecutionGuid,
1170 inputWorkloadExecutionEOLEventId,
1171 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1178 arm::pipe::EmptyOptional(), readableData, offset);
1182 arm::pipe::EmptyOptional(),
1183 weightsWorkloadExecutionGuid,
1184 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1185 LabelsAndEventClasses::TYPE_GUID,
1191 arm::pipe::EmptyOptional(),
1193 weightsWorkloadExecutionGuid,
1194 LabelsAndEventClasses::CHILD_GUID,
1200 arm::pipe::EmptyOptional(),
1201 weightsWorkloadGuid,
1202 weightsWorkloadExecutionGuid,
1203 LabelsAndEventClasses::EXECUTION_OF_GUID,
1210 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1214 arm::pipe::EmptyOptional(),
1215 weightsWorkloadExecutionGuid,
1216 weightsWorkloadExecutionSOLEventGuid,
1217 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1224 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1228 arm::pipe::EmptyOptional(),
1229 weightsWorkloadExecutionGuid,
1230 weightsWorkloadExecutionEOLEventGuid,
1231 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1238 arm::pipe::EmptyOptional(), readableData, offset);
1242 arm::pipe::EmptyOptional(),
1243 biasWorkloadExecutionGuid,
1244 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1245 LabelsAndEventClasses::TYPE_GUID,
1251 arm::pipe::EmptyOptional(),
1253 biasWorkloadExecutionGuid,
1254 LabelsAndEventClasses::CHILD_GUID,
1260 arm::pipe::EmptyOptional(),
1262 biasWorkloadExecutionGuid,
1263 LabelsAndEventClasses::EXECUTION_OF_GUID,
1270 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1274 arm::pipe::EmptyOptional(),
1275 biasWorkloadExecutionGuid,
1276 biasWorkloadExecutionSOLEventGuid,
1277 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1284 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1288 arm::pipe::EmptyOptional(),
1289 biasWorkloadExecutionGuid,
1290 biasWorkloadExecutionEOLEventGuid,
1291 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1298 arm::pipe::EmptyOptional(), readableData, offset);
1302 arm::pipe::EmptyOptional(),
1303 conv2DWorkloadExecutionGuid,
1304 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1305 LabelsAndEventClasses::TYPE_GUID,
1311 arm::pipe::EmptyOptional(),
1313 conv2DWorkloadExecutionGuid,
1314 LabelsAndEventClasses::CHILD_GUID,
1320 arm::pipe::EmptyOptional(),
1322 conv2DWorkloadExecutionGuid,
1323 LabelsAndEventClasses::EXECUTION_OF_GUID,
1330 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1334 arm::pipe::EmptyOptional(),
1335 conv2DWorkloadExecutionGuid,
1336 conv2DWorkloadExecutionSOLEventGuid,
1337 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1344 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1348 arm::pipe::EmptyOptional(),
1349 conv2DWorkloadExecutionGuid,
1350 conv2DWorkloadExecutionEOLEventGuid,
1351 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1358 arm::pipe::EmptyOptional(), readableData, offset);
1362 arm::pipe::EmptyOptional(),
1363 absWorkloadExecutionGuid,
1364 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1365 LabelsAndEventClasses::TYPE_GUID,
1371 arm::pipe::EmptyOptional(),
1373 absWorkloadExecutionGuid,
1374 LabelsAndEventClasses::CHILD_GUID,
1380 arm::pipe::EmptyOptional(),
1382 absWorkloadExecutionGuid,
1383 LabelsAndEventClasses::EXECUTION_OF_GUID,
1390 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1394 arm::pipe::EmptyOptional(),
1395 absWorkloadExecutionGuid,
1396 absWorkloadExecutionSOLEventGuid,
1397 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1404 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1408 arm::pipe::EmptyOptional(),
1409 absWorkloadExecutionGuid,
1410 absWorkloadExecutionEOLEventGuid,
1411 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1418 arm::pipe::EmptyOptional(), readableData, offset);
1422 arm::pipe::EmptyOptional(),
1423 outputWorkloadExecutionGuid,
1424 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1425 LabelsAndEventClasses::TYPE_GUID,
1431 arm::pipe::EmptyOptional(),
1433 outputWorkloadExecutionGuid,
1434 LabelsAndEventClasses::CHILD_GUID,
1440 arm::pipe::EmptyOptional(),
1442 outputWorkloadExecutionGuid,
1443 LabelsAndEventClasses::EXECUTION_OF_GUID,
1450 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1454 arm::pipe::EmptyOptional(),
1455 outputWorkloadExecutionGuid,
1456 outputWorkloadExecutionSOLEventGuid,
1457 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1464 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1468 arm::pipe::EmptyOptional(),
1469 outputWorkloadExecutionGuid,
1470 outputWorkloadExecutionEOLEventGuid,
1471 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1478 arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
1482 arm::pipe::EmptyOptional(),
1484 inferenceEOLEventGuid,
1485 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1489 bufferManager.MarkRead(inferenceReadableBuffer);
1492 bool CompareOutput(std::vector<std::string> output, std::vector<std::string> expectedOutput)
1494 if (output.size() != expectedOutput.size())
1496 std::cerr <<
"output has [" << output.size() <<
"] lines, expected was [" 1497 << expectedOutput.size() <<
"] lines" << std::endl;
1498 std::cerr << std::endl <<
"actual" << std::endl << std::endl;
1499 for (
auto line : output)
1501 std::cerr << line << std::endl;
1503 std::cerr << std::endl <<
"expected" << std::endl << std::endl;
1504 for (
auto line : expectedOutput)
1506 std::cerr << line << std::endl;
1511 for (
unsigned long i = 0; i < output.size(); ++i)
1513 if (output[i] != expectedOutput[i])
1516 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.
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.
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.