2 // Copyright © 2019 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include "ProfilingTestUtils.hpp"
7 #include "ProfilingUtils.hpp"
9 #include <armnn/Descriptors.hpp>
10 #include <armnn/utility/NumericCast.hpp>
12 #include <LabelsAndEventClasses.hpp>
13 #include <Processes.hpp>
14 #include <ProfilingService.hpp>
15 #include <Threads.hpp>
17 #include <test/TestUtils.hpp>
19 #include <boost/test/unit_test.hpp>
21 uint32_t GetStreamMetaDataPacketSize()
23 uint32_t sizeUint32 = sizeof(uint32_t);
24 uint32_t payloadSize = 0;
25 payloadSize += armnn::numeric_cast<uint32_t>(GetSoftwareInfo().size()) + 1;
26 payloadSize += armnn::numeric_cast<uint32_t>(GetHardwareVersion().size()) + 1;
27 payloadSize += armnn::numeric_cast<uint32_t>(GetSoftwareVersion().size()) + 1;
28 payloadSize += armnn::numeric_cast<uint32_t>(GetProcessName().size()) + 1;
30 // Add packetVersionEntries
31 payloadSize += 13 * 2 * sizeUint32;
32 // Add packetVersionCountSize
33 payloadSize += sizeUint32;
35 uint32_t headerSize = 2 * sizeUint32;
36 uint32_t bodySize = 10 * sizeUint32;
38 return headerSize + bodySize + payloadSize;
41 std::vector<BackendId> GetSuitableBackendRegistered()
43 std::vector<BackendId> suitableBackends;
44 if (BackendRegistryInstance().IsBackendRegistered(GetComputeDeviceAsCString(armnn::Compute::CpuRef)))
46 suitableBackends.push_back(armnn::Compute::CpuRef);
48 if (BackendRegistryInstance().IsBackendRegistered(GetComputeDeviceAsCString(armnn::Compute::CpuAcc)))
50 suitableBackends.push_back(armnn::Compute::CpuAcc);
52 if (BackendRegistryInstance().IsBackendRegistered(GetComputeDeviceAsCString(armnn::Compute::GpuAcc)))
54 suitableBackends.push_back(armnn::Compute::GpuAcc);
56 return suitableBackends;
59 inline unsigned int OffsetToNextWord(unsigned int numberOfBytes)
61 unsigned int uint32_t_size = sizeof(uint32_t);
63 unsigned int remainder = numberOfBytes % uint32_t_size;
69 return numberOfBytes + uint32_t_size - remainder;
72 void VerifyTimelineHeaderBinary(const unsigned char* readableData,
74 uint32_t packetDataLength)
76 ARMNN_ASSERT(readableData);
79 unsigned int uint32_t_size = sizeof(uint32_t);
81 // Check the TimelineEventClassBinaryPacket header
82 uint32_t timelineBinaryPacketHeaderWord0 = ReadUint32(readableData, offset);
83 uint32_t timelineBinaryPacketFamily = (timelineBinaryPacketHeaderWord0 >> 26) & 0x0000003F;
84 uint32_t timelineBinaryPacketClass = (timelineBinaryPacketHeaderWord0 >> 19) & 0x0000007F;
85 uint32_t timelineBinaryPacketType = (timelineBinaryPacketHeaderWord0 >> 16) & 0x00000007;
86 uint32_t timelineBinaryPacketStreamId = (timelineBinaryPacketHeaderWord0 >> 0) & 0x00000007;
87 BOOST_CHECK(timelineBinaryPacketFamily == 1);
88 BOOST_CHECK(timelineBinaryPacketClass == 0);
89 BOOST_CHECK(timelineBinaryPacketType == 1);
90 BOOST_CHECK(timelineBinaryPacketStreamId == 0);
91 offset += uint32_t_size;
92 uint32_t timelineBinaryPacketHeaderWord1 = ReadUint32(readableData, offset);
93 uint32_t timelineBinaryPacketSequenceNumber = (timelineBinaryPacketHeaderWord1 >> 24) & 0x00000001;
94 uint32_t timelineBinaryPacketDataLength = (timelineBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF;
95 BOOST_CHECK(timelineBinaryPacketSequenceNumber == 0);
96 BOOST_CHECK(timelineBinaryPacketDataLength == packetDataLength);
97 offset += uint32_t_size;
100 ProfilingGuid VerifyTimelineLabelBinaryPacketData(Optional<ProfilingGuid> guid,
101 const std::string& label,
102 const unsigned char* readableData,
103 unsigned int& offset)
105 ARMNN_ASSERT(readableData);
108 unsigned int uint32_t_size = sizeof(uint32_t);
109 unsigned int uint64_t_size = sizeof(uint64_t);
110 unsigned int label_size = armnn::numeric_cast<unsigned int>(label.size());
113 uint32_t eventClassDeclId = ReadUint32(readableData, offset);
114 BOOST_CHECK(eventClassDeclId == 0);
116 // Check the profiling GUID
117 offset += uint32_t_size;
118 uint64_t readProfilingGuid = ReadUint64(readableData, offset);
119 if (guid.has_value())
121 BOOST_CHECK(readProfilingGuid == guid.value());
125 armnn::profiling::ProfilingService profilingService;
126 BOOST_CHECK(readProfilingGuid == profilingService.GetStaticId(label));
129 // Check the SWTrace label
130 offset += uint64_t_size;
131 uint32_t swTraceLabelLength = ReadUint32(readableData, offset);
132 BOOST_CHECK(swTraceLabelLength == label_size + 1); // Label length including the null-terminator
133 offset += uint32_t_size;
134 BOOST_CHECK(std::memcmp(readableData + offset, // Offset to the label in the buffer
135 label.data(), // The original label
136 swTraceLabelLength - 1) == 0); // The length of the label
138 // SWTrace strings are written in blocks of words, so the offset has to be updated to the next whole word
139 offset += OffsetToNextWord(swTraceLabelLength);
141 ProfilingGuid labelGuid(readProfilingGuid);
145 void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid,
146 ProfilingGuid nameGuid,
147 const unsigned char* readableData,
148 unsigned int& offset)
150 ARMNN_ASSERT(readableData);
153 unsigned int uint32_t_size = sizeof(uint32_t);
154 unsigned int uint64_t_size = sizeof(uint64_t);
157 uint32_t eventClassDeclId = ReadUint32(readableData, offset);
158 BOOST_CHECK(eventClassDeclId == 2);
160 // Check the profiling GUID
161 offset += uint32_t_size;
162 uint64_t readProfilingGuid = ReadUint64(readableData, offset);
163 BOOST_CHECK(readProfilingGuid == guid);
165 offset += uint64_t_size;
166 uint64_t readProfiilngNameGuid = ReadUint64(readableData, offset);
167 BOOST_CHECK(readProfiilngNameGuid == nameGuid);
169 // Update the offset to allow parsing to be continued after this function returns
170 offset += uint64_t_size;
173 void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relationshipType,
174 Optional<ProfilingGuid> relationshipGuid,
175 Optional<ProfilingGuid> headGuid,
176 Optional<ProfilingGuid> tailGuid,
177 Optional<ProfilingGuid> attributeGuid,
178 const unsigned char* readableData,
179 unsigned int& offset)
181 ARMNN_ASSERT(readableData);
183 uint32_t relationshipTypeUint = 0;
184 switch (relationshipType)
186 case ProfilingRelationshipType::RetentionLink:
187 relationshipTypeUint = 0;
189 case ProfilingRelationshipType::ExecutionLink:
190 relationshipTypeUint = 1;
192 case ProfilingRelationshipType::DataLink:
193 relationshipTypeUint = 2;
195 case ProfilingRelationshipType::LabelLink:
196 relationshipTypeUint = 3;
199 BOOST_ERROR("Unknown relationship type");
203 unsigned int uint32_t_size = sizeof(uint32_t);
204 unsigned int uint64_t_size = sizeof(uint64_t);
207 uint32_t eventClassDeclId = ReadUint32(readableData, offset);
208 BOOST_CHECK(eventClassDeclId == 3);
210 // Check the relationship type
211 offset += uint32_t_size;
212 uint32_t readRelationshipTypeUint = ReadUint32(readableData, offset);
213 BOOST_CHECK(readRelationshipTypeUint == relationshipTypeUint);
215 // Check the relationship GUID
216 offset += uint32_t_size;
217 uint64_t readRelationshipGuid = ReadUint64(readableData, offset);
218 if (relationshipGuid.has_value())
220 BOOST_CHECK(readRelationshipGuid == relationshipGuid.value());
224 BOOST_CHECK(readRelationshipGuid != ProfilingGuid(0));
227 // Check the head GUID of the relationship
228 offset += uint64_t_size;
229 uint64_t readHeadRelationshipGuid = ReadUint64(readableData, offset);
230 if (headGuid.has_value())
232 BOOST_CHECK(readHeadRelationshipGuid == headGuid.value());
236 BOOST_CHECK(readHeadRelationshipGuid != ProfilingGuid(0));
239 // Check the tail GUID of the relationship
240 offset += uint64_t_size;
241 uint64_t readTailRelationshipGuid = ReadUint64(readableData, offset);
242 if (tailGuid.has_value())
244 BOOST_CHECK(readTailRelationshipGuid == tailGuid.value());
248 BOOST_CHECK(readTailRelationshipGuid != ProfilingGuid(0));
251 // Check the attribute GUID of the relationship
252 offset += uint64_t_size;
253 uint64_t readAttributeRelationshipGuid = ReadUint64(readableData, offset);
254 if (attributeGuid.has_value())
256 BOOST_CHECK(readAttributeRelationshipGuid == attributeGuid.value());
260 BOOST_CHECK(readAttributeRelationshipGuid == ProfilingGuid(0));
263 // Update the offset to allow parsing to be continued after this function returns
264 offset += uint64_t_size;
267 ProfilingGuid VerifyTimelineEntityBinaryPacketData(Optional<ProfilingGuid> guid,
268 const unsigned char* readableData,
269 unsigned int& offset)
271 ARMNN_ASSERT(readableData);
274 unsigned int uint32_t_size = sizeof(uint32_t);
275 unsigned int uint64_t_size = sizeof(uint64_t);
277 // Reading TimelineEntityClassBinaryPacket
279 uint32_t entityDeclId = ReadUint32(readableData, offset);
280 BOOST_CHECK(entityDeclId == 1);
282 // Check the profiling GUID
283 offset += uint32_t_size;
284 uint64_t readProfilingGuid = ReadUint64(readableData, offset);
286 if (guid.has_value())
288 BOOST_CHECK(readProfilingGuid == guid.value());
292 BOOST_CHECK(readProfilingGuid != ProfilingGuid(0));
295 offset += uint64_t_size;
297 ProfilingGuid entityGuid(readProfilingGuid);
301 ProfilingGuid VerifyTimelineEventBinaryPacket(Optional<uint64_t> timestamp,
302 Optional<int> threadId,
303 Optional<ProfilingGuid> eventGuid,
304 const unsigned char* readableData,
305 unsigned int& offset)
307 ARMNN_ASSERT(readableData);
310 unsigned int uint32_t_size = sizeof(uint32_t);
311 unsigned int uint64_t_size = sizeof(uint64_t);
313 // Reading TimelineEventBinaryPacket
315 uint32_t entityDeclId = ReadUint32(readableData, offset);
316 BOOST_CHECK(entityDeclId == 4);
318 // Check the timestamp
319 offset += uint32_t_size;
320 uint64_t readTimestamp = ReadUint64(readableData, offset);
321 if (timestamp.has_value())
323 BOOST_CHECK(readTimestamp == timestamp.value());
327 BOOST_CHECK(readTimestamp != 0);
330 // Check the thread id
331 offset += uint64_t_size;
332 std::vector<uint8_t> readThreadId(ThreadIdSize, 0);
333 ReadBytes(readableData, offset, ThreadIdSize, readThreadId.data());
334 if (threadId.has_value())
336 BOOST_CHECK(readThreadId == threadId.value());
340 BOOST_CHECK(readThreadId == armnnUtils::Threads::GetCurrentThreadId());
343 // Check the event GUID
344 offset += ThreadIdSize;
345 uint64_t readEventGuid = ReadUint64(readableData, offset);
346 if (eventGuid.has_value())
348 BOOST_CHECK(readEventGuid == eventGuid.value());
352 BOOST_CHECK(readEventGuid != ProfilingGuid(0));
355 offset += uint64_t_size;
357 ProfilingGuid eventid(readEventGuid);
361 void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId)
363 using namespace armnn;
365 // Create runtime in which test will run
366 armnn::IRuntime::CreationOptions options;
367 options.m_ProfilingOptions.m_EnableProfiling = true;
368 options.m_ProfilingOptions.m_TimelineEnabled = true;
369 armnn::Runtime runtime(options);
370 GetProfilingService(&runtime).ResetExternalProfilingOptions(options.m_ProfilingOptions, false);
372 profiling::ProfilingServiceRuntimeHelper profilingServiceHelper(GetProfilingService(&runtime));
373 profilingServiceHelper.ForceTransitionToState(ProfilingState::NotConnected);
374 profilingServiceHelper.ForceTransitionToState(ProfilingState::WaitingForAck);
375 profilingServiceHelper.ForceTransitionToState(ProfilingState::Active);
377 // build up the structure of the network
378 INetworkPtr net(INetwork::Create());
380 // Convolution details
381 TensorInfo inputInfo({ 1, 2, 5, 1 }, DataType::Float32);
382 TensorInfo weightInfo({ 3, 2, 3, 1 }, DataType::Float32);
383 TensorInfo biasInfo({ 3 }, DataType::Float32);
384 TensorInfo outputInfo({ 1, 3, 7, 1 }, DataType::Float32);
385 std::vector<float> weightsData{
395 ConstTensor weights(weightInfo, weightsData);
397 Optional<ConstTensor> optionalBiases;
398 std::vector<float> biasesData{ 1.0f, 0.0f, 0.0f };
399 ConstTensor biases(biasInfo, biasesData);
400 optionalBiases = Optional<ConstTensor>(biases);
403 IConnectableLayer* input = net->AddInputLayer(0, "input");
405 // Convolution2d layer
406 Convolution2dDescriptor conv2dDesc;
407 conv2dDesc.m_StrideX = 1;
408 conv2dDesc.m_StrideY = 1;
409 conv2dDesc.m_PadLeft = 0;
410 conv2dDesc.m_PadRight = 0;
411 conv2dDesc.m_PadTop = 2;
412 conv2dDesc.m_PadBottom = 2;
413 conv2dDesc.m_BiasEnabled = true;
414 IConnectableLayer* conv2d = net->AddConvolution2dLayer(conv2dDesc, weights, optionalBiases);
417 armnn::ActivationDescriptor activationDesc;
418 armnn::IConnectableLayer* const activation = net->AddActivationLayer(activationDesc, "activation");
421 IConnectableLayer* output = net->AddOutputLayer(0, "output");
423 input->GetOutputSlot(0).Connect(conv2d->GetInputSlot(0));
424 conv2d->GetOutputSlot(0).Connect(activation->GetInputSlot(0));
425 activation->GetOutputSlot(0).Connect(output->GetInputSlot(0));
427 input->GetOutputSlot(0).SetTensorInfo(inputInfo);
428 conv2d->GetOutputSlot(0).SetTensorInfo(outputInfo);
429 activation->GetOutputSlot(0).SetTensorInfo(outputInfo);
431 // optimize the network
432 std::vector<armnn::BackendId> backends = { backendId };
433 IOptimizedNetworkPtr optNet = Optimize(*net, backends, runtime.GetDeviceSpec());
435 ProfilingGuid optNetGuid = optNet->GetGuid();
437 // Load it into the runtime. It should success.
438 armnn::NetworkId netId;
439 BOOST_TEST(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success);
441 profiling::BufferManager& bufferManager = profilingServiceHelper.GetProfilingBufferManager();
442 auto readableBuffer = bufferManager.GetReadableBuffer();
444 // Profiling is enabled, the post-optimisation structure should be created
445 BOOST_CHECK(readableBuffer != nullptr);
446 unsigned int size = readableBuffer->GetSize();
448 const unsigned char* readableData = readableBuffer->GetReadableData();
449 BOOST_CHECK(readableData != nullptr);
451 unsigned int offset = 0;
454 VerifyTimelineHeaderBinary(readableData, offset, size - 8);
455 BOOST_TEST_MESSAGE("HEADER OK");
457 // Post-optimisation network
459 VerifyTimelineEntityBinaryPacketData(optNetGuid, readableData, offset);
460 BOOST_TEST_MESSAGE("NETWORK ENTITY OK");
462 // Entity - Type relationship
463 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
466 LabelsAndEventClasses::NETWORK_GUID,
467 LabelsAndEventClasses::TYPE_GUID,
470 BOOST_TEST_MESSAGE("NETWORK TYPE RELATIONSHIP OK");
472 // Network - START OF LIFE
473 ProfilingGuid networkSolEventGuid = VerifyTimelineEventBinaryPacket(EmptyOptional(),
478 BOOST_TEST_MESSAGE("NETWORK START OF LIFE EVENT OK");
480 // Network - START OF LIFE event relationship
481 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
485 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
488 BOOST_TEST_MESSAGE("NETWORK START OF LIFE RELATIONSHIP OK");
491 int processID = armnnUtils::Processes::GetCurrentId();
492 std::stringstream ss;
494 std::string processIdLabel = ss.str();
495 VerifyTimelineLabelBinaryPacketData(EmptyOptional(), processIdLabel, readableData, offset);
496 BOOST_TEST_MESSAGE("PROCESS ID LABEL OK");
498 // Entity - Process ID relationship
499 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
503 LabelsAndEventClasses::PROCESS_ID_GUID,
506 BOOST_TEST_MESSAGE("NETWORK PROCESS ID RELATIONSHIP OK");
509 // Input layer entity
510 VerifyTimelineEntityBinaryPacketData(input->GetGuid(), readableData, offset);
511 BOOST_TEST_MESSAGE("INPUT ENTITY OK");
514 ProfilingGuid inputLabelGuid = VerifyTimelineLabelBinaryPacketData(EmptyOptional(), "input", readableData, offset);
515 BOOST_TEST_MESSAGE("INPUT NAME LABEL OK");
517 // Entity - Name relationship
518 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
522 LabelsAndEventClasses::NAME_GUID,
525 BOOST_TEST_MESSAGE("INPUT NAME RELATIONSHIP OK");
527 // Entity - Type relationship
528 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
531 LabelsAndEventClasses::LAYER_GUID,
532 LabelsAndEventClasses::TYPE_GUID,
535 BOOST_TEST_MESSAGE("INPUT TYPE RELATIONSHIP OK");
537 // Network - Input layer relationship
538 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
542 LabelsAndEventClasses::CHILD_GUID,
545 BOOST_TEST_MESSAGE("NETWORK - INPUT CHILD RELATIONSHIP OK");
548 // Conv2d layer entity
549 VerifyTimelineEntityBinaryPacketData(conv2d->GetGuid(), readableData, offset);
552 ProfilingGuid conv2dNameLabelGuid = VerifyTimelineLabelBinaryPacketData(
553 EmptyOptional(), "<Unnamed>", readableData, offset);
554 BOOST_TEST_MESSAGE("CONV2D NAME LABEL OK");
556 // Entity - Name relationship
557 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
561 LabelsAndEventClasses::NAME_GUID,
564 BOOST_TEST_MESSAGE("CONV2D NAME RELATIONSHIP OK");
566 // Entity - Type relationship
567 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
570 LabelsAndEventClasses::LAYER_GUID,
571 LabelsAndEventClasses::TYPE_GUID,
574 BOOST_TEST_MESSAGE("CONV2D TYPE RELATIONSHIP OK");
576 // Network - Conv2d layer relationship
577 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
581 LabelsAndEventClasses::CHILD_GUID,
584 BOOST_TEST_MESSAGE("NETWORK - CONV2D CHILD RELATIONSHIP OK");
586 // Input layer - Conv2d layer relationship
587 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
591 LabelsAndEventClasses::CONNECTION_GUID,
594 BOOST_TEST_MESSAGE("INPUT - CONV2D LAYER CONNECTION OK");
597 // Conv2d workload entity
598 ProfilingGuid conv2DWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
599 BOOST_TEST_MESSAGE("CONV2D WORKLOAD ENTITY OK");
601 // Entity - Type relationship
602 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
605 LabelsAndEventClasses::WORKLOAD_GUID,
606 LabelsAndEventClasses::TYPE_GUID,
609 BOOST_TEST_MESSAGE("CONV2D WORKLOAD TYPE RELATIONSHIP OK");
612 ProfilingGuid backendIdLabelGuid = VerifyTimelineLabelBinaryPacketData(
613 EmptyOptional(), backendId.Get(), readableData, offset);
615 // Entity - BackendId relationship
616 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
620 LabelsAndEventClasses::BACKENDID_GUID,
623 BOOST_TEST_MESSAGE("CONV2D WORKLOAD BACKEND ID RELATIONSHIP OK");
626 // Conv2d layer - Conv2d workload relationship
627 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
631 LabelsAndEventClasses::CHILD_GUID,
634 BOOST_TEST_MESSAGE("CONV2D LAYER - WORKLOAD CHILD RELATIONSHIP OK");
637 // Activation layer entity
638 VerifyTimelineEntityBinaryPacketData(activation->GetGuid(), readableData, offset);
639 BOOST_TEST_MESSAGE("ACTIVATION ENTITY OK");
642 ProfilingGuid activationLabelGuid = VerifyTimelineLabelBinaryPacketData(
643 EmptyOptional(), "activation", readableData, offset);
644 BOOST_TEST_MESSAGE("ACTIVATION NAME LABEL OK");
646 // Entity - Name relationship
647 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
649 activation->GetGuid(),
651 LabelsAndEventClasses::NAME_GUID,
654 BOOST_TEST_MESSAGE("ACTIVATION LAYER - NAME RELATIONSHIP OK");
656 // Entity - Type relationship
657 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
659 activation->GetGuid(),
660 LabelsAndEventClasses::LAYER_GUID,
661 LabelsAndEventClasses::TYPE_GUID,
664 BOOST_TEST_MESSAGE("ACTIVATION LAYER TYPE RELATIONSHIP OK");
666 // Network - Activation layer relationship
667 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
670 activation->GetGuid(),
671 LabelsAndEventClasses::CHILD_GUID,
674 BOOST_TEST_MESSAGE("NETWORK - ACTIVATION LAYER CHILD RELATIONSHIP OK");
676 // Conv2d layer - Activation layer relationship
677 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
680 activation->GetGuid(),
681 LabelsAndEventClasses::CONNECTION_GUID,
684 BOOST_TEST_MESSAGE("CONV2D LAYER - ACTIVATION LAYER CONNECTION OK");
686 // Activation workload
687 // Activation workload entity
688 ProfilingGuid activationWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
689 BOOST_TEST_MESSAGE("ACTIVATION WORKLOAD ENTITY OK");
691 // Entity - Type relationship
692 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
694 activationWorkloadGuid,
695 LabelsAndEventClasses::WORKLOAD_GUID,
696 LabelsAndEventClasses::TYPE_GUID,
699 BOOST_TEST_MESSAGE("ACTIVATION WORKLAD TYPE RELATIONSHIP OK");
702 VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset);
703 BOOST_TEST_MESSAGE("BACKEND ID LABEL OK");
705 // Entity - BackendId relationship
706 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
708 activationWorkloadGuid,
710 LabelsAndEventClasses::BACKENDID_GUID,
713 BOOST_TEST_MESSAGE("ACTIVATION WORKLOAD BACKEND ID RELATIONSHIP OK");
715 // Activation layer - Activation workload relationship
716 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
718 activation->GetGuid(),
719 activationWorkloadGuid,
720 LabelsAndEventClasses::CHILD_GUID,
723 BOOST_TEST_MESSAGE("ACTIVATION LAYER - WORKLOAD CHILD RELATIONSHIP OK");
726 // Output layer entity
727 VerifyTimelineEntityBinaryPacketData(output->GetGuid(), readableData, offset);
728 BOOST_TEST_MESSAGE("OUTPUT LAYER ENTITY OK");
731 ProfilingGuid outputLabelGuid = VerifyTimelineLabelBinaryPacketData(
732 EmptyOptional(), "output", readableData, offset);
734 // Entity - Name relationship
735 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
739 LabelsAndEventClasses::NAME_GUID,
742 BOOST_TEST_MESSAGE("OUTPUT LAYER NAME RELATIONSHIP OK");
744 // Entity - Type relationship
745 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
748 LabelsAndEventClasses::LAYER_GUID,
749 LabelsAndEventClasses::TYPE_GUID,
752 BOOST_TEST_MESSAGE("OUTPUT LAYER TYPE RELATIONSHIP OK");
754 // Network - Output layer relationship
755 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
759 LabelsAndEventClasses::CHILD_GUID,
762 BOOST_TEST_MESSAGE("NETWORK - OUTPUT LAYER CHILD RELATIONSHIP OK");
764 // Activation layer - Output layer relationship
765 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
767 activation->GetGuid(),
769 LabelsAndEventClasses::CONNECTION_GUID,
772 BOOST_TEST_MESSAGE("ACTIVATION LAYER - OUTPUT LAYER CONNECTION OK");
774 bufferManager.MarkRead(readableBuffer);
776 // Creates structures for input & output.
777 std::vector<float> inputData(inputInfo.GetNumElements());
778 std::vector<float> outputData(outputInfo.GetNumElements());
780 InputTensors inputTensors
782 {0, ConstTensor(runtime.GetInputTensorInfo(netId, 0), inputData.data())}
784 OutputTensors outputTensors
786 {0, Tensor(runtime.GetOutputTensorInfo(netId, 0), outputData.data())}
789 // Does the inference.
790 runtime.EnqueueWorkload(netId, inputTensors, outputTensors);
792 // Get readable buffer for input workload
793 auto inputReadableBuffer = bufferManager.GetReadableBuffer();
794 BOOST_CHECK(inputReadableBuffer != nullptr);
796 // Get readable buffer for output workload
797 auto outputReadableBuffer = bufferManager.GetReadableBuffer();
798 BOOST_CHECK(outputReadableBuffer != nullptr);
800 // Get readable buffer for inference timeline
801 auto inferenceReadableBuffer = bufferManager.GetReadableBuffer();
802 BOOST_CHECK(inferenceReadableBuffer != nullptr);
804 // Validate input workload data
805 size = inputReadableBuffer->GetSize();
806 BOOST_CHECK(size == 164);
808 readableData = inputReadableBuffer->GetReadableData();
809 BOOST_CHECK(readableData != nullptr);
814 VerifyTimelineHeaderBinary(readableData, offset, 156);
815 BOOST_TEST_MESSAGE("INPUT WORKLOAD HEADER OK");
818 // Input workload entity
819 ProfilingGuid inputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
820 BOOST_TEST_MESSAGE("INPUT WORKLOAD TYPE RELATIONSHIP OK");
822 // Entity - Type relationship
823 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
826 LabelsAndEventClasses::WORKLOAD_GUID,
827 LabelsAndEventClasses::TYPE_GUID,
830 BOOST_TEST_MESSAGE("INPUT WORKLOAD TYPE RELATIONSHIP OK");
833 VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset);
835 // Entity - BackendId relationship
836 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
840 LabelsAndEventClasses::BACKENDID_GUID,
843 BOOST_TEST_MESSAGE("INPUT WORKLOAD BACKEND ID RELATIONSHIP OK");
845 // Input layer - Input workload relationship
846 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
850 LabelsAndEventClasses::CHILD_GUID,
853 BOOST_TEST_MESSAGE("INPUT LAYER - INPUT WORKLOAD CHILD RELATIONSHIP OK");
855 bufferManager.MarkRead(inputReadableBuffer);
857 // Validate output workload data
858 size = outputReadableBuffer->GetSize();
859 BOOST_CHECK(size == 164);
861 readableData = outputReadableBuffer->GetReadableData();
862 BOOST_CHECK(readableData != nullptr);
867 VerifyTimelineHeaderBinary(readableData, offset, 156);
868 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD HEADER OK");
871 // Output workload entity
872 ProfilingGuid outputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
873 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD ENTITY OK");
875 // Entity - Type relationship
876 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
879 LabelsAndEventClasses::WORKLOAD_GUID,
880 LabelsAndEventClasses::TYPE_GUID,
883 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD TYPE RELATIONSHIP OK");
886 VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset);
887 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD LABEL OK");
889 // Entity - BackendId relationship
890 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
894 LabelsAndEventClasses::BACKENDID_GUID,
897 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD BACKEND ID RELATIONSHIP OK");
899 // Output layer - Output workload relationship
900 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
904 LabelsAndEventClasses::CHILD_GUID,
907 BOOST_TEST_MESSAGE("OUTPUT LAYER - OUTPUT WORKLOAD CHILD RELATIONSHIP OK");
909 bufferManager.MarkRead(outputReadableBuffer);
911 // Validate inference data
912 size = inferenceReadableBuffer->GetSize();
914 BOOST_CHECK(size == 1228 + 10 * ThreadIdSize);
916 readableData = inferenceReadableBuffer->GetReadableData();
917 BOOST_CHECK(readableData != nullptr);
922 VerifyTimelineHeaderBinary(readableData, offset, 1220 + 10 * ThreadIdSize);
923 BOOST_TEST_MESSAGE("INFERENCE HEADER OK");
925 // Inference timeline trace
927 ProfilingGuid inferenceGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
928 BOOST_TEST_MESSAGE("INFERENCE ENTITY OK");
930 // Entity - Type relationship
931 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
934 LabelsAndEventClasses::INFERENCE_GUID,
935 LabelsAndEventClasses::TYPE_GUID,
938 BOOST_TEST_MESSAGE("INFERENCE TYPE RELATIONSHIP OK");
940 // Network - Inference relationship
941 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
945 LabelsAndEventClasses::EXECUTION_OF_GUID,
948 BOOST_TEST_MESSAGE("NETWORK - INFERENCE EXECUTION_OF RELATIONSHIP OK");
950 // Start Inference life
951 // Event packet - timeline, threadId, eventGuid
952 ProfilingGuid inferenceEventGuid = VerifyTimelineEventBinaryPacket(
953 EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
954 BOOST_TEST_MESSAGE("INFERENCE START OF LIFE EVENT OK");
956 // Inference - event relationship
957 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
961 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
964 BOOST_TEST_MESSAGE("INFERENCE START OF LIFE RELATIONSHIP OK");
967 // Input workload execution
968 // Input workload execution entity
969 ProfilingGuid inputWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
970 EmptyOptional(), readableData, offset);
971 BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION ENTITY OK");
973 // Entity - Type relationship
974 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
976 inputWorkloadExecutionGuid,
977 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
978 LabelsAndEventClasses::TYPE_GUID,
981 BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION TYPE RELATIONSHIP OK");
983 // Inference - Workload execution relationship
984 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
987 inputWorkloadExecutionGuid,
988 LabelsAndEventClasses::CHILD_GUID,
991 BOOST_TEST_MESSAGE("INPUT WORKLOAD - INPUT WORKLOAD EXECUTION RELATIONSHIP OK");
993 // Workload - Workload execution relationship
994 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
997 inputWorkloadExecutionGuid,
998 LabelsAndEventClasses::EXECUTION_OF_GUID,
1001 BOOST_TEST_MESSAGE("INPUT WORKLOAD - INPUT WORKLOAD EXECUTION RELATIONSHIP OK");
1003 // Start Input workload execution life
1004 // Event packet - timeline, threadId, eventGuid
1005 ProfilingGuid inputWorkloadExecutionSOLEventId = VerifyTimelineEventBinaryPacket(
1006 EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
1007 BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION - START OF LIFE EVENT OK");
1009 // Input workload execution - event relationship
1010 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
1012 inputWorkloadExecutionGuid,
1013 inputWorkloadExecutionSOLEventId,
1014 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1017 BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION - START OF LIFE EVENT RELATIONSHIP OK");
1019 // End of Input workload execution life
1020 // Event packet - timeline, threadId, eventGuid
1021 ProfilingGuid inputWorkloadExecutionEOLEventId = VerifyTimelineEventBinaryPacket(
1022 EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
1023 BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION - END OF LIFE EVENT OK");
1025 // Input workload execution - event relationship
1026 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
1028 inputWorkloadExecutionGuid,
1029 inputWorkloadExecutionEOLEventId,
1030 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1033 BOOST_TEST_MESSAGE("INPUT WORKLOAD EXECUTION - END OF LIFE EVENT RELATIONSHIP OK");
1035 // Conv2d workload execution
1036 // Conv2d workload execution entity
1037 ProfilingGuid conv2DWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
1038 EmptyOptional(), readableData, offset);
1039 BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION ENTITY OK");
1041 // Entity - Type relationship
1042 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
1044 conv2DWorkloadExecutionGuid,
1045 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1046 LabelsAndEventClasses::TYPE_GUID,
1049 BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION TYPE RELATIONSHIP OK");
1051 // Inference - Workload execution relationship
1052 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
1055 conv2DWorkloadExecutionGuid,
1056 LabelsAndEventClasses::CHILD_GUID,
1059 BOOST_TEST_MESSAGE("INFERENCE - CONV2D WORKLOAD EXECUTION CHILD RELATIONSHIP OK");
1061 // Workload - Workload execution relationship
1062 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
1065 conv2DWorkloadExecutionGuid,
1066 LabelsAndEventClasses::EXECUTION_OF_GUID,
1069 BOOST_TEST_MESSAGE("CONV2D WORKLOAD - CONV2D WORKLOAD EXECUTION RELATIONSHIP OK");
1071 // Start Conv2d workload execution life
1072 // Event packet - timeline, threadId, eventGuid
1073 ProfilingGuid conv2DWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket(
1074 EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
1075 BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION START OF LIFE EVENT OK");
1077 // Conv2d workload execution - event relationship
1078 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
1080 conv2DWorkloadExecutionGuid,
1081 conv2DWorkloadExecutionSOLEventGuid,
1082 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1085 BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION START OF LIFE RELATIONSHIP OK");
1087 // End of Conv2d workload execution life
1088 // Event packet - timeline, threadId, eventGuid
1089 ProfilingGuid conv2DWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket(
1090 EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
1091 BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION END OF LIFE EVENT OK");
1093 // Conv2d workload execution - event relationship
1094 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
1096 conv2DWorkloadExecutionGuid,
1097 conv2DWorkloadExecutionEOLEventGuid,
1098 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1101 BOOST_TEST_MESSAGE("CONV2D WORKLOAD EXECUTION END OF LIFE RELATIONSHIP OK");
1103 // Activation workload execution
1104 // Activation workload execution entity
1105 ProfilingGuid activationWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
1106 EmptyOptional(), readableData, offset);
1107 BOOST_TEST_MESSAGE("ACTIVATION WORKLOAD EXECUTION ENTITY OK");
1109 // Entity - Type relationship
1110 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
1112 activationWorkloadExecutionGuid,
1113 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1114 LabelsAndEventClasses::TYPE_GUID,
1117 BOOST_TEST_MESSAGE("ACTIVATION WORKLOAD EXECUTION TYPE RELATIONSHIP OK");
1119 // Inference - Workload execution relationship
1120 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
1123 activationWorkloadExecutionGuid,
1124 LabelsAndEventClasses::CHILD_GUID,
1127 BOOST_TEST_MESSAGE("INFERENCE - ACTIVATION WORKLOAD EXECUTION CHILD RELATIONSHIP OK");
1129 // Workload - Workload execution relationship
1130 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
1132 activationWorkloadGuid,
1133 activationWorkloadExecutionGuid,
1134 LabelsAndEventClasses::EXECUTION_OF_GUID,
1137 BOOST_TEST_MESSAGE("ACTIVATION WORKLOAD - ACTIVATION WORKLOAD EXECUTION RELATIONSHIP OK");
1139 // Start Activation workload execution life
1140 // Event packet - timeline, threadId, eventGuid
1141 ProfilingGuid activationWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket(
1142 EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
1143 BOOST_TEST_MESSAGE("ACTIVATION WORKLOAD EXECUTION START OF LIFE EVENT OK");
1145 // Activation workload execution - event relationship
1146 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
1148 activationWorkloadExecutionGuid,
1149 activationWorkloadExecutionSOLEventGuid,
1150 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1153 BOOST_TEST_MESSAGE("ACTIVATION WORKLOAD EXECUTION START OF LIFE RELATIONSHIP OK");
1155 // End of Activation workload execution life
1156 // Event packet - timeline, threadId, eventGuid
1157 ProfilingGuid activationWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket(
1158 EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
1159 BOOST_TEST_MESSAGE("ACTIVATION WORKLOAD EXECUTION END OF LIFE EVENT OK");
1161 // Activation workload execution - event relationship
1162 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
1164 activationWorkloadExecutionGuid,
1165 activationWorkloadExecutionEOLEventGuid,
1166 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1169 BOOST_TEST_MESSAGE("ACTIVATION WORKLOAD EXECUTION END OF LIFE RELATIONSHIP OK");
1171 // Output workload execution
1172 // Output workload execution entity
1173 ProfilingGuid outputWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
1174 EmptyOptional(), readableData, offset);
1175 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION ENTITY OK");
1177 // Entity - Type relationship
1178 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
1180 outputWorkloadExecutionGuid,
1181 LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
1182 LabelsAndEventClasses::TYPE_GUID,
1185 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION TYPE RELATIONSHIP OK");
1187 // Inference - Workload execution relationship
1188 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
1191 outputWorkloadExecutionGuid,
1192 LabelsAndEventClasses::CHILD_GUID,
1195 BOOST_TEST_MESSAGE("INFERENCE - OUTPUT WORKLOAD EXECUTION CHILD RELATIONSHIP OK");
1197 // Workload - Workload execution relationship
1198 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
1201 outputWorkloadExecutionGuid,
1202 LabelsAndEventClasses::EXECUTION_OF_GUID,
1205 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD - OUTPUT WORKLOAD EXECUTION EXECUTION_OF RELATIONSHIP OK");
1207 // Start Output workload execution life
1208 // Event packet - timeline, threadId, eventGuid
1209 ProfilingGuid outputWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket(
1210 EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
1211 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION START OF LIFE EVENT OK");
1213 // Output workload execution - event relationship
1214 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
1216 outputWorkloadExecutionGuid,
1217 outputWorkloadExecutionSOLEventGuid,
1218 LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
1221 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION - START OF LIFE EVENT RELATIONSHIP OK");
1223 // End of Normalize workload execution life
1224 // Event packet - timeline, threadId, eventGuid
1225 ProfilingGuid outputWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket(
1226 EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
1227 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION END OF LIFE EVENT OK");
1229 // Output workload execution - event relationship
1230 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
1232 outputWorkloadExecutionGuid,
1233 outputWorkloadExecutionEOLEventGuid,
1234 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1237 BOOST_TEST_MESSAGE("OUTPUT WORKLOAD EXECUTION - END OF LIFE EVENT RELATIONSHIP OK");
1239 // End of Inference life
1240 // Event packet - timeline, threadId, eventGuid
1241 ProfilingGuid inferenceEOLEventGuid = VerifyTimelineEventBinaryPacket(
1242 EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
1243 BOOST_TEST_MESSAGE("INFERENCE END OF LIFE EVENT OK");
1245 // Inference - event relationship
1246 VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
1249 inferenceEOLEventGuid,
1250 LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
1253 BOOST_TEST_MESSAGE("INFERENCE - END OF LIFE EVENT RELATIONSHIP OK");
1255 bufferManager.MarkRead(inferenceReadableBuffer);
1258 bool CompareOutput(std::vector<std::string> output, std::vector<std::string> expectedOutput)
1260 if (output.size() != expectedOutput.size())
1262 std::cerr << "output has [" << output.size() << "] lines, expected was ["
1263 << expectedOutput.size() << "] lines" << std::endl;
1264 std::cerr << std::endl << "actual" << std::endl << std::endl;
1265 for (auto line : output)
1267 std::cerr << line << std::endl;
1269 std::cerr << std::endl << "expected" << std::endl << std::endl;
1270 for (auto line : expectedOutput)
1272 std::cerr << line << std::endl;
1277 for (unsigned long i = 0; i < output.size(); ++i)
1279 if (output[i] != expectedOutput[i])
1282 std::cerr << i << ": actual [" << output[i] << "] expected [" << expectedOutput[i] << "]" << std::endl;