Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 1 | // |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 2 | // Copyright © 2019 Arm Ltd and Contributors. All rights reserved. |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "ProfilingTestUtils.hpp" |
| 7 | #include "ProfilingUtils.hpp" |
| 8 | |
| 9 | #include <armnn/Descriptors.hpp> |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 10 | #include <armnn/utility/Assert.hpp> |
Matthew Sloyan | 371b70e | 2020-09-11 10:14:57 +0100 | [diff] [blame] | 11 | #include <armnn/utility/NumericCast.hpp> |
| 12 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 13 | #include <LabelsAndEventClasses.hpp> |
Jim Flynn | f771321 | 2020-07-14 09:50:59 +0100 | [diff] [blame] | 14 | #include <Processes.hpp> |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 15 | #include <ProfilingService.hpp> |
Jim Flynn | f771321 | 2020-07-14 09:50:59 +0100 | [diff] [blame] | 16 | #include <Threads.hpp> |
Sadik Armagan | ea41b57 | 2020-03-19 18:16:46 +0000 | [diff] [blame] | 17 | |
| 18 | #include <test/TestUtils.hpp> |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 19 | |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 20 | #include <doctest/doctest.h> |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 21 | |
Finn Williams | a0de056 | 2020-04-22 12:27:37 +0100 | [diff] [blame] | 22 | uint32_t GetStreamMetaDataPacketSize() |
| 23 | { |
| 24 | uint32_t sizeUint32 = sizeof(uint32_t); |
| 25 | uint32_t payloadSize = 0; |
Matthew Sloyan | 371b70e | 2020-09-11 10:14:57 +0100 | [diff] [blame] | 26 | payloadSize += armnn::numeric_cast<uint32_t>(GetSoftwareInfo().size()) + 1; |
| 27 | payloadSize += armnn::numeric_cast<uint32_t>(GetHardwareVersion().size()) + 1; |
| 28 | payloadSize += armnn::numeric_cast<uint32_t>(GetSoftwareVersion().size()) + 1; |
| 29 | payloadSize += armnn::numeric_cast<uint32_t>(GetProcessName().size()) + 1; |
Finn Williams | a0de056 | 2020-04-22 12:27:37 +0100 | [diff] [blame] | 30 | |
| 31 | // Add packetVersionEntries |
Jim Flynn | 83d08a9 | 2020-07-09 13:48:16 +0100 | [diff] [blame] | 32 | payloadSize += 13 * 2 * sizeUint32; |
Finn Williams | a0de056 | 2020-04-22 12:27:37 +0100 | [diff] [blame] | 33 | // Add packetVersionCountSize |
| 34 | payloadSize += sizeUint32; |
| 35 | |
| 36 | uint32_t headerSize = 2 * sizeUint32; |
| 37 | uint32_t bodySize = 10 * sizeUint32; |
| 38 | |
| 39 | return headerSize + bodySize + payloadSize; |
| 40 | } |
| 41 | |
Jan Eilers | f78c767 | 2020-07-01 18:09:39 +0100 | [diff] [blame] | 42 | std::vector<BackendId> GetSuitableBackendRegistered() |
| 43 | { |
| 44 | std::vector<BackendId> suitableBackends; |
| 45 | if (BackendRegistryInstance().IsBackendRegistered(GetComputeDeviceAsCString(armnn::Compute::CpuRef))) |
| 46 | { |
| 47 | suitableBackends.push_back(armnn::Compute::CpuRef); |
| 48 | } |
| 49 | if (BackendRegistryInstance().IsBackendRegistered(GetComputeDeviceAsCString(armnn::Compute::CpuAcc))) |
| 50 | { |
| 51 | suitableBackends.push_back(armnn::Compute::CpuAcc); |
| 52 | } |
| 53 | if (BackendRegistryInstance().IsBackendRegistered(GetComputeDeviceAsCString(armnn::Compute::GpuAcc))) |
| 54 | { |
| 55 | suitableBackends.push_back(armnn::Compute::GpuAcc); |
| 56 | } |
| 57 | return suitableBackends; |
| 58 | } |
| 59 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 60 | inline unsigned int OffsetToNextWord(unsigned int numberOfBytes) |
| 61 | { |
| 62 | unsigned int uint32_t_size = sizeof(uint32_t); |
| 63 | |
| 64 | unsigned int remainder = numberOfBytes % uint32_t_size; |
| 65 | if (remainder == 0) |
| 66 | { |
| 67 | return numberOfBytes; |
| 68 | } |
| 69 | |
| 70 | return numberOfBytes + uint32_t_size - remainder; |
| 71 | } |
| 72 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 73 | void VerifyTimelineHeaderBinary(const unsigned char* readableData, |
| 74 | unsigned int& offset, |
| 75 | uint32_t packetDataLength) |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 76 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 77 | ARMNN_ASSERT(readableData); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 78 | |
| 79 | // Utils |
| 80 | unsigned int uint32_t_size = sizeof(uint32_t); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 81 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 82 | // Check the TimelineEventClassBinaryPacket header |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 83 | uint32_t timelineBinaryPacketHeaderWord0 = ReadUint32(readableData, offset); |
| 84 | uint32_t timelineBinaryPacketFamily = (timelineBinaryPacketHeaderWord0 >> 26) & 0x0000003F; |
| 85 | uint32_t timelineBinaryPacketClass = (timelineBinaryPacketHeaderWord0 >> 19) & 0x0000007F; |
| 86 | uint32_t timelineBinaryPacketType = (timelineBinaryPacketHeaderWord0 >> 16) & 0x00000007; |
| 87 | uint32_t timelineBinaryPacketStreamId = (timelineBinaryPacketHeaderWord0 >> 0) & 0x00000007; |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 88 | CHECK(timelineBinaryPacketFamily == 1); |
| 89 | CHECK(timelineBinaryPacketClass == 0); |
| 90 | CHECK(timelineBinaryPacketType == 1); |
| 91 | CHECK(timelineBinaryPacketStreamId == 0); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 92 | offset += uint32_t_size; |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 93 | uint32_t timelineBinaryPacketHeaderWord1 = ReadUint32(readableData, offset); |
| 94 | uint32_t timelineBinaryPacketSequenceNumber = (timelineBinaryPacketHeaderWord1 >> 24) & 0x00000001; |
| 95 | uint32_t timelineBinaryPacketDataLength = (timelineBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF; |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 96 | CHECK(timelineBinaryPacketSequenceNumber == 0); |
| 97 | CHECK(timelineBinaryPacketDataLength == packetDataLength); |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 98 | offset += uint32_t_size; |
| 99 | } |
| 100 | |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 101 | ProfilingGuid VerifyTimelineLabelBinaryPacketData(Optional<ProfilingGuid> guid, |
| 102 | const std::string& label, |
| 103 | const unsigned char* readableData, |
| 104 | unsigned int& offset) |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 105 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 106 | ARMNN_ASSERT(readableData); |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 107 | |
| 108 | // Utils |
| 109 | unsigned int uint32_t_size = sizeof(uint32_t); |
| 110 | unsigned int uint64_t_size = sizeof(uint64_t); |
Matthew Sloyan | 371b70e | 2020-09-11 10:14:57 +0100 | [diff] [blame] | 111 | unsigned int label_size = armnn::numeric_cast<unsigned int>(label.size()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 112 | |
| 113 | // Check the decl id |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 114 | uint32_t eventClassDeclId = ReadUint32(readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 115 | CHECK(eventClassDeclId == 0); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 116 | |
| 117 | // Check the profiling GUID |
| 118 | offset += uint32_t_size; |
| 119 | uint64_t readProfilingGuid = ReadUint64(readableData, offset); |
| 120 | if (guid.has_value()) |
| 121 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 122 | CHECK(readProfilingGuid == guid.value()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 123 | } |
| 124 | else |
| 125 | { |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 126 | armnn::profiling::ProfilingService profilingService; |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 127 | CHECK(readProfilingGuid == profilingService.GetStaticId(label)); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | // Check the SWTrace label |
| 131 | offset += uint64_t_size; |
| 132 | uint32_t swTraceLabelLength = ReadUint32(readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 133 | CHECK(swTraceLabelLength == label_size + 1); // Label length including the null-terminator |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 134 | offset += uint32_t_size; |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 135 | CHECK(std::memcmp(readableData + offset, // Offset to the label in the buffer |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 136 | label.data(), // The original label |
| 137 | swTraceLabelLength - 1) == 0); // The length of the label |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 138 | |
| 139 | // SWTrace strings are written in blocks of words, so the offset has to be updated to the next whole word |
| 140 | offset += OffsetToNextWord(swTraceLabelLength); |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 141 | |
| 142 | ProfilingGuid labelGuid(readProfilingGuid); |
| 143 | return labelGuid; |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 144 | } |
| 145 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 146 | void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, |
Jim Flynn | 1892d21 | 2020-05-26 21:10:49 +0100 | [diff] [blame] | 147 | ProfilingGuid nameGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 148 | const unsigned char* readableData, |
| 149 | unsigned int& offset) |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 150 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 151 | ARMNN_ASSERT(readableData); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 152 | |
| 153 | // Utils |
| 154 | unsigned int uint32_t_size = sizeof(uint32_t); |
| 155 | unsigned int uint64_t_size = sizeof(uint64_t); |
| 156 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 157 | // Check the decl id |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 158 | uint32_t eventClassDeclId = ReadUint32(readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 159 | CHECK(eventClassDeclId == 2); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 160 | |
| 161 | // Check the profiling GUID |
| 162 | offset += uint32_t_size; |
| 163 | uint64_t readProfilingGuid = ReadUint64(readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 164 | CHECK(readProfilingGuid == guid); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 165 | |
Jim Flynn | 1892d21 | 2020-05-26 21:10:49 +0100 | [diff] [blame] | 166 | offset += uint64_t_size; |
| 167 | uint64_t readProfiilngNameGuid = ReadUint64(readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 168 | CHECK(readProfiilngNameGuid == nameGuid); |
Jim Flynn | 1892d21 | 2020-05-26 21:10:49 +0100 | [diff] [blame] | 169 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 170 | // Update the offset to allow parsing to be continued after this function returns |
| 171 | offset += uint64_t_size; |
| 172 | } |
| 173 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 174 | void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relationshipType, |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 175 | Optional<ProfilingGuid> relationshipGuid, |
| 176 | Optional<ProfilingGuid> headGuid, |
| 177 | Optional<ProfilingGuid> tailGuid, |
| 178 | Optional<ProfilingGuid> attributeGuid, |
| 179 | const unsigned char* readableData, |
| 180 | unsigned int& offset) |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 181 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 182 | ARMNN_ASSERT(readableData); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 183 | |
| 184 | uint32_t relationshipTypeUint = 0; |
| 185 | switch (relationshipType) |
| 186 | { |
| 187 | case ProfilingRelationshipType::RetentionLink: |
| 188 | relationshipTypeUint = 0; |
| 189 | break; |
| 190 | case ProfilingRelationshipType::ExecutionLink: |
| 191 | relationshipTypeUint = 1; |
| 192 | break; |
| 193 | case ProfilingRelationshipType::DataLink: |
| 194 | relationshipTypeUint = 2; |
| 195 | break; |
| 196 | case ProfilingRelationshipType::LabelLink: |
| 197 | relationshipTypeUint = 3; |
| 198 | break; |
| 199 | default: |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 200 | FAIL("Unknown relationship type"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 201 | } |
| 202 | |
| 203 | // Utils |
| 204 | unsigned int uint32_t_size = sizeof(uint32_t); |
| 205 | unsigned int uint64_t_size = sizeof(uint64_t); |
| 206 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 207 | // Check the decl id |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 208 | uint32_t eventClassDeclId = ReadUint32(readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 209 | CHECK(eventClassDeclId == 3); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 210 | |
| 211 | // Check the relationship type |
| 212 | offset += uint32_t_size; |
| 213 | uint32_t readRelationshipTypeUint = ReadUint32(readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 214 | CHECK(readRelationshipTypeUint == relationshipTypeUint); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 215 | |
| 216 | // Check the relationship GUID |
| 217 | offset += uint32_t_size; |
| 218 | uint64_t readRelationshipGuid = ReadUint64(readableData, offset); |
| 219 | if (relationshipGuid.has_value()) |
| 220 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 221 | CHECK(readRelationshipGuid == relationshipGuid.value()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 222 | } |
| 223 | else |
| 224 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 225 | CHECK(readRelationshipGuid != ProfilingGuid(0)); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 226 | } |
| 227 | |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 228 | // Check the head GUID of the relationship |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 229 | offset += uint64_t_size; |
| 230 | uint64_t readHeadRelationshipGuid = ReadUint64(readableData, offset); |
| 231 | if (headGuid.has_value()) |
| 232 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 233 | CHECK(readHeadRelationshipGuid == headGuid.value()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 234 | } |
| 235 | else |
| 236 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 237 | CHECK(readHeadRelationshipGuid != ProfilingGuid(0)); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 238 | } |
| 239 | |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 240 | // Check the tail GUID of the relationship |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 241 | offset += uint64_t_size; |
| 242 | uint64_t readTailRelationshipGuid = ReadUint64(readableData, offset); |
| 243 | if (tailGuid.has_value()) |
| 244 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 245 | CHECK(readTailRelationshipGuid == tailGuid.value()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 246 | } |
| 247 | else |
| 248 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 249 | CHECK(readTailRelationshipGuid != ProfilingGuid(0)); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 250 | } |
| 251 | |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 252 | // Check the attribute GUID of the relationship |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 253 | offset += uint64_t_size; |
| 254 | uint64_t readAttributeRelationshipGuid = ReadUint64(readableData, offset); |
| 255 | if (attributeGuid.has_value()) |
| 256 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 257 | CHECK(readAttributeRelationshipGuid == attributeGuid.value()); |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 258 | } |
| 259 | else |
| 260 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 261 | CHECK(readAttributeRelationshipGuid == ProfilingGuid(0)); |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 262 | } |
| 263 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 264 | // Update the offset to allow parsing to be continued after this function returns |
| 265 | offset += uint64_t_size; |
| 266 | } |
| 267 | |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 268 | ProfilingGuid VerifyTimelineEntityBinaryPacketData(Optional<ProfilingGuid> guid, |
| 269 | const unsigned char* readableData, |
| 270 | unsigned int& offset) |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 271 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 272 | ARMNN_ASSERT(readableData); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 273 | |
| 274 | // Utils |
| 275 | unsigned int uint32_t_size = sizeof(uint32_t); |
| 276 | unsigned int uint64_t_size = sizeof(uint64_t); |
| 277 | |
| 278 | // Reading TimelineEntityClassBinaryPacket |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 279 | // Check the decl_id |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 280 | uint32_t entityDeclId = ReadUint32(readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 281 | CHECK(entityDeclId == 1); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 282 | |
| 283 | // Check the profiling GUID |
| 284 | offset += uint32_t_size; |
| 285 | uint64_t readProfilingGuid = ReadUint64(readableData, offset); |
| 286 | |
| 287 | if (guid.has_value()) |
| 288 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 289 | CHECK(readProfilingGuid == guid.value()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 290 | } |
| 291 | else |
| 292 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 293 | CHECK(readProfilingGuid != ProfilingGuid(0)); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | offset += uint64_t_size; |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 297 | |
| 298 | ProfilingGuid entityGuid(readProfilingGuid); |
| 299 | return entityGuid; |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 300 | } |
| 301 | |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 302 | ProfilingGuid VerifyTimelineEventBinaryPacket(Optional<uint64_t> timestamp, |
Jim Flynn | 1fdeb99 | 2020-07-09 07:28:37 +0100 | [diff] [blame] | 303 | Optional<int> threadId, |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 304 | Optional<ProfilingGuid> eventGuid, |
| 305 | const unsigned char* readableData, |
| 306 | unsigned int& offset) |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 307 | { |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 308 | ARMNN_ASSERT(readableData); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 309 | |
| 310 | // Utils |
| 311 | unsigned int uint32_t_size = sizeof(uint32_t); |
| 312 | unsigned int uint64_t_size = sizeof(uint64_t); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 313 | |
| 314 | // Reading TimelineEventBinaryPacket |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 315 | // Check the decl_id |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 316 | uint32_t entityDeclId = ReadUint32(readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 317 | CHECK(entityDeclId == 4); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 318 | |
| 319 | // Check the timestamp |
| 320 | offset += uint32_t_size; |
| 321 | uint64_t readTimestamp = ReadUint64(readableData, offset); |
| 322 | if (timestamp.has_value()) |
| 323 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 324 | CHECK(readTimestamp == timestamp.value()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 325 | } |
| 326 | else |
| 327 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 328 | CHECK(readTimestamp != 0); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 329 | } |
| 330 | |
| 331 | // Check the thread id |
| 332 | offset += uint64_t_size; |
Colm Donelan | 5bb3d8a | 2020-05-12 16:36:46 +0100 | [diff] [blame] | 333 | std::vector<uint8_t> readThreadId(ThreadIdSize, 0); |
| 334 | ReadBytes(readableData, offset, ThreadIdSize, readThreadId.data()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 335 | if (threadId.has_value()) |
| 336 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 337 | CHECK(readThreadId == threadId.value()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 338 | } |
| 339 | else |
| 340 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 341 | CHECK(readThreadId == armnnUtils::Threads::GetCurrentThreadId()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 342 | } |
| 343 | |
| 344 | // Check the event GUID |
Colm Donelan | 5bb3d8a | 2020-05-12 16:36:46 +0100 | [diff] [blame] | 345 | offset += ThreadIdSize; |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 346 | uint64_t readEventGuid = ReadUint64(readableData, offset); |
| 347 | if (eventGuid.has_value()) |
| 348 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 349 | CHECK(readEventGuid == eventGuid.value()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 350 | } |
| 351 | else |
| 352 | { |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 353 | CHECK(readEventGuid != ProfilingGuid(0)); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | offset += uint64_t_size; |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 357 | |
| 358 | ProfilingGuid eventid(readEventGuid); |
| 359 | return eventid; |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 360 | } |
| 361 | |
| 362 | void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) |
| 363 | { |
| 364 | using namespace armnn; |
| 365 | |
| 366 | // Create runtime in which test will run |
| 367 | armnn::IRuntime::CreationOptions options; |
| 368 | options.m_ProfilingOptions.m_EnableProfiling = true; |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 369 | options.m_ProfilingOptions.m_TimelineEnabled = true; |
Kevin May | d92a6e4 | 2021-02-04 10:27:41 +0000 | [diff] [blame] | 370 | armnn::RuntimeImpl runtime(options); |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 371 | GetProfilingService(&runtime).ResetExternalProfilingOptions(options.m_ProfilingOptions, false); |
| 372 | |
| 373 | profiling::ProfilingServiceRuntimeHelper profilingServiceHelper(GetProfilingService(&runtime)); |
| 374 | profilingServiceHelper.ForceTransitionToState(ProfilingState::NotConnected); |
| 375 | profilingServiceHelper.ForceTransitionToState(ProfilingState::WaitingForAck); |
| 376 | profilingServiceHelper.ForceTransitionToState(ProfilingState::Active); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 377 | |
| 378 | // build up the structure of the network |
| 379 | INetworkPtr net(INetwork::Create()); |
| 380 | |
| 381 | // Convolution details |
| 382 | TensorInfo inputInfo({ 1, 2, 5, 1 }, DataType::Float32); |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 383 | TensorInfo weightInfo({ 3, 2, 3, 1 }, DataType::Float32); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 384 | TensorInfo biasInfo({ 3 }, DataType::Float32); |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 385 | TensorInfo outputInfo({ 1, 3, 7, 1 }, DataType::Float32); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 386 | std::vector<float> weightsData{ |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 387 | 1.0f, 0.0f, 0.0f, |
| 388 | 0.0f, 2.0f, -1.5f, |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 389 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 390 | 0.0f, 0.0f, 0.0f, |
| 391 | 0.2f, 0.2f, 0.2f, |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 392 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 393 | 0.5f, 0.0f, 0.5f, |
| 394 | 0.0f, -1.0f, 0.0f |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 395 | }; |
| 396 | ConstTensor weights(weightInfo, weightsData); |
| 397 | |
| 398 | Optional<ConstTensor> optionalBiases; |
| 399 | std::vector<float> biasesData{ 1.0f, 0.0f, 0.0f }; |
| 400 | ConstTensor biases(biasInfo, biasesData); |
| 401 | optionalBiases = Optional<ConstTensor>(biases); |
| 402 | |
| 403 | // Input layer |
| 404 | IConnectableLayer* input = net->AddInputLayer(0, "input"); |
| 405 | |
| 406 | // Convolution2d layer |
| 407 | Convolution2dDescriptor conv2dDesc; |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 408 | conv2dDesc.m_StrideX = 1; |
| 409 | conv2dDesc.m_StrideY = 1; |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 410 | conv2dDesc.m_PadLeft = 0; |
| 411 | conv2dDesc.m_PadRight = 0; |
| 412 | conv2dDesc.m_PadTop = 2; |
| 413 | conv2dDesc.m_PadBottom = 2; |
| 414 | conv2dDesc.m_BiasEnabled = true; |
| 415 | IConnectableLayer* conv2d = net->AddConvolution2dLayer(conv2dDesc, weights, optionalBiases); |
| 416 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 417 | // Abs layer |
| 418 | armnn::ElementwiseUnaryDescriptor absDesc; |
| 419 | armnn::IConnectableLayer* const abs = net->AddElementwiseUnaryLayer(absDesc, "abs"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 420 | |
| 421 | // Output layer |
| 422 | IConnectableLayer* output = net->AddOutputLayer(0, "output"); |
| 423 | |
| 424 | input->GetOutputSlot(0).Connect(conv2d->GetInputSlot(0)); |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 425 | conv2d->GetOutputSlot(0).Connect(abs->GetInputSlot(0)); |
| 426 | abs->GetOutputSlot(0).Connect(output->GetInputSlot(0)); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 427 | |
| 428 | input->GetOutputSlot(0).SetTensorInfo(inputInfo); |
| 429 | conv2d->GetOutputSlot(0).SetTensorInfo(outputInfo); |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 430 | abs->GetOutputSlot(0).SetTensorInfo(outputInfo); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 431 | |
| 432 | // optimize the network |
| 433 | std::vector<armnn::BackendId> backends = { backendId }; |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 434 | IOptimizedNetworkPtr optNet = Optimize(*net, backends, runtime.GetDeviceSpec()); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 435 | |
| 436 | ProfilingGuid optNetGuid = optNet->GetGuid(); |
| 437 | |
| 438 | // Load it into the runtime. It should success. |
| 439 | armnn::NetworkId netId; |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 440 | CHECK(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 441 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 442 | profiling::BufferManager& bufferManager = profilingServiceHelper.GetProfilingBufferManager(); |
| 443 | auto readableBuffer = bufferManager.GetReadableBuffer(); |
| 444 | |
Jim Flynn | f771321 | 2020-07-14 09:50:59 +0100 | [diff] [blame] | 445 | // Profiling is enabled, the post-optimisation structure should be created |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 446 | CHECK(readableBuffer != nullptr); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 447 | unsigned int size = readableBuffer->GetSize(); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 448 | |
| 449 | const unsigned char* readableData = readableBuffer->GetReadableData(); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 450 | CHECK(readableData != nullptr); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 451 | |
| 452 | unsigned int offset = 0; |
| 453 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 454 | // Verify Header |
Jim Flynn | f771321 | 2020-07-14 09:50:59 +0100 | [diff] [blame] | 455 | VerifyTimelineHeaderBinary(readableData, offset, size - 8); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 456 | MESSAGE("HEADER OK"); |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 457 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 458 | // Post-optimisation network |
| 459 | // Network entity |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 460 | VerifyTimelineEntityBinaryPacketData(optNetGuid, readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 461 | MESSAGE("NETWORK ENTITY OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 462 | |
| 463 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 464 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 465 | EmptyOptional(), |
| 466 | optNetGuid, |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 467 | LabelsAndEventClasses::NETWORK_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 468 | LabelsAndEventClasses::TYPE_GUID, |
| 469 | readableData, |
| 470 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 471 | MESSAGE("NETWORK TYPE RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 472 | |
Jim Flynn | f771321 | 2020-07-14 09:50:59 +0100 | [diff] [blame] | 473 | // Network - START OF LIFE |
| 474 | ProfilingGuid networkSolEventGuid = VerifyTimelineEventBinaryPacket(EmptyOptional(), |
| 475 | EmptyOptional(), |
| 476 | EmptyOptional(), |
| 477 | readableData, |
| 478 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 479 | MESSAGE("NETWORK START OF LIFE EVENT OK"); |
Jim Flynn | f771321 | 2020-07-14 09:50:59 +0100 | [diff] [blame] | 480 | |
| 481 | // Network - START OF LIFE event relationship |
| 482 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 483 | EmptyOptional(), |
| 484 | optNetGuid, |
| 485 | networkSolEventGuid, |
| 486 | LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, |
| 487 | readableData, |
| 488 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 489 | MESSAGE("NETWORK START OF LIFE RELATIONSHIP OK"); |
Jim Flynn | f771321 | 2020-07-14 09:50:59 +0100 | [diff] [blame] | 490 | |
| 491 | // Process ID Label |
| 492 | int processID = armnnUtils::Processes::GetCurrentId(); |
| 493 | std::stringstream ss; |
| 494 | ss << processID; |
| 495 | std::string processIdLabel = ss.str(); |
| 496 | VerifyTimelineLabelBinaryPacketData(EmptyOptional(), processIdLabel, readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 497 | MESSAGE("PROCESS ID LABEL OK"); |
Jim Flynn | f771321 | 2020-07-14 09:50:59 +0100 | [diff] [blame] | 498 | |
| 499 | // Entity - Process ID relationship |
| 500 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 501 | EmptyOptional(), |
| 502 | optNetGuid, |
| 503 | EmptyOptional(), |
| 504 | LabelsAndEventClasses::PROCESS_ID_GUID, |
| 505 | readableData, |
| 506 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 507 | MESSAGE("NETWORK PROCESS ID RELATIONSHIP OK"); |
Jim Flynn | f771321 | 2020-07-14 09:50:59 +0100 | [diff] [blame] | 508 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 509 | // Input layer |
| 510 | // Input layer entity |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 511 | VerifyTimelineEntityBinaryPacketData(input->GetGuid(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 512 | MESSAGE("INPUT ENTITY OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 513 | |
| 514 | // Name Entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 515 | ProfilingGuid inputLabelGuid = VerifyTimelineLabelBinaryPacketData(EmptyOptional(), "input", readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 516 | MESSAGE("INPUT NAME LABEL OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 517 | |
| 518 | // Entity - Name relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 519 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 520 | EmptyOptional(), |
| 521 | input->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 522 | inputLabelGuid, |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 523 | LabelsAndEventClasses::NAME_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 524 | readableData, |
| 525 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 526 | MESSAGE("INPUT NAME RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 527 | |
| 528 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 529 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 530 | EmptyOptional(), |
| 531 | input->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 532 | LabelsAndEventClasses::LAYER_GUID, |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 533 | LabelsAndEventClasses::TYPE_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 534 | readableData, |
| 535 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 536 | MESSAGE("INPUT TYPE RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 537 | |
| 538 | // Network - Input layer relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 539 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 540 | EmptyOptional(), |
| 541 | optNetGuid, |
| 542 | input->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 543 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 544 | readableData, |
| 545 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 546 | MESSAGE("NETWORK - INPUT CHILD RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 547 | |
| 548 | // Conv2d layer |
| 549 | // Conv2d layer entity |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 550 | VerifyTimelineEntityBinaryPacketData(conv2d->GetGuid(), readableData, offset); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 551 | |
| 552 | // Name entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 553 | ProfilingGuid conv2dNameLabelGuid = VerifyTimelineLabelBinaryPacketData( |
| 554 | EmptyOptional(), "<Unnamed>", readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 555 | MESSAGE("CONV2D NAME LABEL OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 556 | |
| 557 | // Entity - Name relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 558 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 559 | EmptyOptional(), |
| 560 | conv2d->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 561 | conv2dNameLabelGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 562 | LabelsAndEventClasses::NAME_GUID, |
| 563 | readableData, |
| 564 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 565 | MESSAGE("CONV2D NAME RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 566 | |
| 567 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 568 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 569 | EmptyOptional(), |
| 570 | conv2d->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 571 | LabelsAndEventClasses::LAYER_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 572 | LabelsAndEventClasses::TYPE_GUID, |
| 573 | readableData, |
| 574 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 575 | MESSAGE("CONV2D TYPE RELATIONSHIP OK"); |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 576 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 577 | // Network - Conv2d layer relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 578 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 579 | EmptyOptional(), |
| 580 | optNetGuid, |
| 581 | conv2d->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 582 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 583 | readableData, |
| 584 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 585 | MESSAGE("NETWORK - CONV2D CHILD RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 586 | |
| 587 | // Input layer - Conv2d layer relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 588 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 589 | EmptyOptional(), |
| 590 | input->GetGuid(), |
| 591 | conv2d->GetGuid(), |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 592 | LabelsAndEventClasses::CONNECTION_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 593 | readableData, |
| 594 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 595 | MESSAGE("INPUT - CONV2D LAYER CONNECTION OK"); |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 596 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 597 | // Conv2d workload |
| 598 | // Conv2d workload entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 599 | ProfilingGuid conv2DWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 600 | MESSAGE("CONV2D WORKLOAD ENTITY OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 601 | |
| 602 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 603 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 604 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 605 | conv2DWorkloadGuid, |
| 606 | LabelsAndEventClasses::WORKLOAD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 607 | LabelsAndEventClasses::TYPE_GUID, |
| 608 | readableData, |
| 609 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 610 | MESSAGE("CONV2D WORKLOAD TYPE RELATIONSHIP OK"); |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 611 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 612 | // BackendId entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 613 | ProfilingGuid backendIdLabelGuid = VerifyTimelineLabelBinaryPacketData( |
| 614 | EmptyOptional(), backendId.Get(), readableData, offset); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 615 | |
| 616 | // Entity - BackendId relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 617 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 618 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 619 | conv2DWorkloadGuid, |
| 620 | backendIdLabelGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 621 | LabelsAndEventClasses::BACKENDID_GUID, |
| 622 | readableData, |
| 623 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 624 | MESSAGE("CONV2D WORKLOAD BACKEND ID RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 625 | |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 626 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 627 | // Conv2d layer - Conv2d workload relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 628 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 629 | EmptyOptional(), |
| 630 | conv2d->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 631 | conv2DWorkloadGuid, |
| 632 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 633 | readableData, |
| 634 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 635 | MESSAGE("CONV2D LAYER - WORKLOAD CHILD RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 636 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 637 | // Abs layer |
| 638 | // Abs layer entity |
| 639 | VerifyTimelineEntityBinaryPacketData(abs->GetGuid(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 640 | MESSAGE("ABS ENTITY OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 641 | |
| 642 | // Name entity |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 643 | ProfilingGuid absLabelGuid = VerifyTimelineLabelBinaryPacketData( |
| 644 | EmptyOptional(), "abs", readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 645 | MESSAGE("ABS NAME LABEL OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 646 | |
| 647 | // Entity - Name relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 648 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 649 | EmptyOptional(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 650 | abs->GetGuid(), |
| 651 | absLabelGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 652 | LabelsAndEventClasses::NAME_GUID, |
| 653 | readableData, |
| 654 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 655 | MESSAGE("ABS LAYER - NAME RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 656 | |
| 657 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 658 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 659 | EmptyOptional(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 660 | abs->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 661 | LabelsAndEventClasses::LAYER_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 662 | LabelsAndEventClasses::TYPE_GUID, |
| 663 | readableData, |
| 664 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 665 | MESSAGE("ABS LAYER TYPE RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 666 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 667 | // Network - Abs layer relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 668 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 669 | EmptyOptional(), |
| 670 | optNetGuid, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 671 | abs->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 672 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 673 | readableData, |
| 674 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 675 | MESSAGE("NETWORK - ABS LAYER CHILD RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 676 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 677 | // Conv2d layer - Abs layer relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 678 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 679 | EmptyOptional(), |
| 680 | conv2d->GetGuid(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 681 | abs->GetGuid(), |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 682 | LabelsAndEventClasses::CONNECTION_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 683 | readableData, |
| 684 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 685 | MESSAGE("CONV2D LAYER - ABS LAYER CONNECTION OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 686 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 687 | // Abs workload |
| 688 | // Abs workload entity |
| 689 | ProfilingGuid absWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 690 | MESSAGE("ABS WORKLOAD ENTITY OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 691 | |
| 692 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 693 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 694 | EmptyOptional(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 695 | absWorkloadGuid, |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 696 | LabelsAndEventClasses::WORKLOAD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 697 | LabelsAndEventClasses::TYPE_GUID, |
| 698 | readableData, |
| 699 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 700 | MESSAGE("ABS WORKLAD TYPE RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 701 | |
| 702 | // BackendId entity |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 703 | VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 704 | MESSAGE("BACKEND ID LABEL OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 705 | |
| 706 | // Entity - BackendId relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 707 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 708 | EmptyOptional(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 709 | absWorkloadGuid, |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 710 | backendIdLabelGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 711 | LabelsAndEventClasses::BACKENDID_GUID, |
| 712 | readableData, |
| 713 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 714 | MESSAGE("ABS WORKLOAD BACKEND ID RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 715 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 716 | // Abs layer - Abs workload relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 717 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 718 | EmptyOptional(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 719 | abs->GetGuid(), |
| 720 | absWorkloadGuid, |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 721 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 722 | readableData, |
| 723 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 724 | MESSAGE("ABS LAYER - WORKLOAD CHILD RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 725 | |
| 726 | // Output layer |
| 727 | // Output layer entity |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 728 | VerifyTimelineEntityBinaryPacketData(output->GetGuid(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 729 | MESSAGE("OUTPUT LAYER ENTITY OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 730 | |
| 731 | // Name entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 732 | ProfilingGuid outputLabelGuid = VerifyTimelineLabelBinaryPacketData( |
| 733 | EmptyOptional(), "output", readableData, offset); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 734 | |
| 735 | // Entity - Name relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 736 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 737 | EmptyOptional(), |
| 738 | output->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 739 | outputLabelGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 740 | LabelsAndEventClasses::NAME_GUID, |
| 741 | readableData, |
| 742 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 743 | MESSAGE("OUTPUT LAYER NAME RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 744 | |
| 745 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 746 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 747 | EmptyOptional(), |
| 748 | output->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 749 | LabelsAndEventClasses::LAYER_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 750 | LabelsAndEventClasses::TYPE_GUID, |
| 751 | readableData, |
| 752 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 753 | MESSAGE("OUTPUT LAYER TYPE RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 754 | |
| 755 | // Network - Output layer relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 756 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 757 | EmptyOptional(), |
| 758 | optNetGuid, |
| 759 | output->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 760 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 761 | readableData, |
| 762 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 763 | MESSAGE("NETWORK - OUTPUT LAYER CHILD RELATIONSHIP OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 764 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 765 | // Abs layer - Output layer relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 766 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 767 | EmptyOptional(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 768 | abs->GetGuid(), |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 769 | output->GetGuid(), |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 770 | LabelsAndEventClasses::CONNECTION_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 771 | readableData, |
| 772 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 773 | MESSAGE("ABS LAYER - OUTPUT LAYER CONNECTION OK"); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 774 | |
| 775 | bufferManager.MarkRead(readableBuffer); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 776 | |
| 777 | // Creates structures for input & output. |
| 778 | std::vector<float> inputData(inputInfo.GetNumElements()); |
| 779 | std::vector<float> outputData(outputInfo.GetNumElements()); |
| 780 | |
| 781 | InputTensors inputTensors |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 782 | { |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 783 | {0, ConstTensor(runtime.GetInputTensorInfo(netId, 0), inputData.data())} |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 784 | }; |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 785 | OutputTensors outputTensors |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 786 | { |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 787 | {0, Tensor(runtime.GetOutputTensorInfo(netId, 0), outputData.data())} |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 788 | }; |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 789 | |
| 790 | // Does the inference. |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 791 | runtime.EnqueueWorkload(netId, inputTensors, outputTensors); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 792 | |
Finn Williams | b6a402f | 2020-03-24 13:46:22 +0000 | [diff] [blame] | 793 | // Get readable buffer for input workload |
| 794 | auto inputReadableBuffer = bufferManager.GetReadableBuffer(); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 795 | CHECK(inputReadableBuffer != nullptr); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 796 | |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 797 | // Get readable buffer for output workload |
| 798 | auto outputReadableBuffer = bufferManager.GetReadableBuffer(); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 799 | CHECK(outputReadableBuffer != nullptr); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 800 | |
Finn Williams | b6a402f | 2020-03-24 13:46:22 +0000 | [diff] [blame] | 801 | // Get readable buffer for inference timeline |
| 802 | auto inferenceReadableBuffer = bufferManager.GetReadableBuffer(); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 803 | CHECK(inferenceReadableBuffer != nullptr); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 804 | |
| 805 | // Validate input workload data |
| 806 | size = inputReadableBuffer->GetSize(); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 807 | CHECK(size == 164); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 808 | |
| 809 | readableData = inputReadableBuffer->GetReadableData(); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 810 | CHECK(readableData != nullptr); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 811 | |
| 812 | offset = 0; |
| 813 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 814 | // Verify Header |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 815 | VerifyTimelineHeaderBinary(readableData, offset, 156); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 816 | MESSAGE("INPUT WORKLOAD HEADER OK"); |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 817 | |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 818 | // Input workload |
| 819 | // Input workload entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 820 | ProfilingGuid inputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 821 | MESSAGE("INPUT WORKLOAD TYPE RELATIONSHIP OK"); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 822 | |
| 823 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 824 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 825 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 826 | inputWorkloadGuid, |
| 827 | LabelsAndEventClasses::WORKLOAD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 828 | LabelsAndEventClasses::TYPE_GUID, |
| 829 | readableData, |
| 830 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 831 | MESSAGE("INPUT WORKLOAD TYPE RELATIONSHIP OK"); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 832 | |
| 833 | // BackendId entity |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 834 | VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 835 | |
| 836 | // Entity - BackendId relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 837 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 838 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 839 | inputWorkloadGuid, |
| 840 | backendIdLabelGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 841 | LabelsAndEventClasses::BACKENDID_GUID, |
| 842 | readableData, |
| 843 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 844 | MESSAGE("INPUT WORKLOAD BACKEND ID RELATIONSHIP OK"); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 845 | |
| 846 | // Input layer - Input workload relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 847 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 848 | EmptyOptional(), |
| 849 | input->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 850 | inputWorkloadGuid, |
| 851 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 852 | readableData, |
| 853 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 854 | MESSAGE("INPUT LAYER - INPUT WORKLOAD CHILD RELATIONSHIP OK"); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 855 | |
| 856 | bufferManager.MarkRead(inputReadableBuffer); |
| 857 | |
| 858 | // Validate output workload data |
| 859 | size = outputReadableBuffer->GetSize(); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 860 | CHECK(size == 164); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 861 | |
| 862 | readableData = outputReadableBuffer->GetReadableData(); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 863 | CHECK(readableData != nullptr); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 864 | |
| 865 | offset = 0; |
| 866 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 867 | // Verify Header |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 868 | VerifyTimelineHeaderBinary(readableData, offset, 156); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 869 | MESSAGE("OUTPUT WORKLOAD HEADER OK"); |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 870 | |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 871 | // Output workload |
| 872 | // Output workload entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 873 | ProfilingGuid outputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 874 | MESSAGE("OUTPUT WORKLOAD ENTITY OK"); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 875 | |
| 876 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 877 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 878 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 879 | outputWorkloadGuid, |
| 880 | LabelsAndEventClasses::WORKLOAD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 881 | LabelsAndEventClasses::TYPE_GUID, |
| 882 | readableData, |
| 883 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 884 | MESSAGE("OUTPUT WORKLOAD TYPE RELATIONSHIP OK"); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 885 | |
| 886 | // BackendId entity |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 887 | VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 888 | MESSAGE("OUTPUT WORKLOAD LABEL OK"); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 889 | |
| 890 | // Entity - BackendId relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 891 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 892 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 893 | outputWorkloadGuid, |
| 894 | backendIdLabelGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 895 | LabelsAndEventClasses::BACKENDID_GUID, |
| 896 | readableData, |
| 897 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 898 | MESSAGE("OUTPUT WORKLOAD BACKEND ID RELATIONSHIP OK"); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 899 | |
| 900 | // Output layer - Output workload relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 901 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 902 | EmptyOptional(), |
| 903 | output->GetGuid(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 904 | outputWorkloadGuid, |
| 905 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 906 | readableData, |
| 907 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 908 | MESSAGE("OUTPUT LAYER - OUTPUT WORKLOAD CHILD RELATIONSHIP OK"); |
Narumol Prangnawarat | aa68e01 | 2019-11-29 17:17:43 +0000 | [diff] [blame] | 909 | |
| 910 | bufferManager.MarkRead(outputReadableBuffer); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 911 | |
| 912 | // Validate inference data |
| 913 | size = inferenceReadableBuffer->GetSize(); |
Jan Eilers | a10e2a2 | 2020-03-26 12:04:54 +0000 | [diff] [blame] | 914 | |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 915 | CHECK(size == 1228 + 10 * ThreadIdSize); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 916 | |
| 917 | readableData = inferenceReadableBuffer->GetReadableData(); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 918 | CHECK(readableData != nullptr); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 919 | |
| 920 | offset = 0; |
| 921 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 922 | // Verify Header |
Finn Williams | 0a336dc | 2020-05-11 15:39:58 +0100 | [diff] [blame] | 923 | VerifyTimelineHeaderBinary(readableData, offset, 1220 + 10 * ThreadIdSize); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 924 | MESSAGE("INFERENCE HEADER OK"); |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 925 | |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 926 | // Inference timeline trace |
| 927 | // Inference entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 928 | ProfilingGuid inferenceGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 929 | MESSAGE("INFERENCE ENTITY OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 930 | |
| 931 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 932 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 933 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 934 | inferenceGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 935 | LabelsAndEventClasses::INFERENCE_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 936 | LabelsAndEventClasses::TYPE_GUID, |
| 937 | readableData, |
| 938 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 939 | MESSAGE("INFERENCE TYPE RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 940 | |
| 941 | // Network - Inference relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 942 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 943 | EmptyOptional(), |
| 944 | optNetGuid, |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 945 | inferenceGuid, |
| 946 | LabelsAndEventClasses::EXECUTION_OF_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 947 | readableData, |
| 948 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 949 | MESSAGE("NETWORK - INFERENCE EXECUTION_OF RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 950 | |
| 951 | // Start Inference life |
| 952 | // Event packet - timeline, threadId, eventGuid |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 953 | ProfilingGuid inferenceEventGuid = VerifyTimelineEventBinaryPacket( |
| 954 | EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 955 | MESSAGE("INFERENCE START OF LIFE EVENT OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 956 | |
| 957 | // Inference - event relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 958 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 959 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 960 | inferenceGuid, |
| 961 | inferenceEventGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 962 | LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, |
| 963 | readableData, |
| 964 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 965 | MESSAGE("INFERENCE START OF LIFE RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 966 | |
| 967 | // Execution |
| 968 | // Input workload execution |
| 969 | // Input workload execution entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 970 | ProfilingGuid inputWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData( |
| 971 | EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 972 | MESSAGE("INPUT WORKLOAD EXECUTION ENTITY OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 973 | |
| 974 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 975 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 976 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 977 | inputWorkloadExecutionGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 978 | LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 979 | LabelsAndEventClasses::TYPE_GUID, |
| 980 | readableData, |
| 981 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 982 | MESSAGE("INPUT WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 983 | |
| 984 | // Inference - Workload execution relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 985 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 986 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 987 | inferenceGuid, |
| 988 | inputWorkloadExecutionGuid, |
| 989 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 990 | readableData, |
| 991 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 992 | MESSAGE("INPUT WORKLOAD - INPUT WORKLOAD EXECUTION RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 993 | |
| 994 | // Workload - Workload execution relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 995 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 996 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 997 | inputWorkloadGuid, |
| 998 | inputWorkloadExecutionGuid, |
| 999 | LabelsAndEventClasses::EXECUTION_OF_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1000 | readableData, |
| 1001 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1002 | MESSAGE("INPUT WORKLOAD - INPUT WORKLOAD EXECUTION RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1003 | |
| 1004 | // Start Input workload execution life |
| 1005 | // Event packet - timeline, threadId, eventGuid |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1006 | ProfilingGuid inputWorkloadExecutionSOLEventId = VerifyTimelineEventBinaryPacket( |
| 1007 | EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1008 | MESSAGE("INPUT WORKLOAD EXECUTION - START OF LIFE EVENT OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1009 | |
| 1010 | // Input workload execution - event relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1011 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 1012 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1013 | inputWorkloadExecutionGuid, |
| 1014 | inputWorkloadExecutionSOLEventId, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1015 | LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, |
| 1016 | readableData, |
| 1017 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1018 | MESSAGE("INPUT WORKLOAD EXECUTION - START OF LIFE EVENT RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1019 | |
| 1020 | // End of Input workload execution life |
| 1021 | // Event packet - timeline, threadId, eventGuid |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1022 | ProfilingGuid inputWorkloadExecutionEOLEventId = VerifyTimelineEventBinaryPacket( |
| 1023 | EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1024 | MESSAGE("INPUT WORKLOAD EXECUTION - END OF LIFE EVENT OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1025 | |
| 1026 | // Input workload execution - event relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1027 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 1028 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1029 | inputWorkloadExecutionGuid, |
| 1030 | inputWorkloadExecutionEOLEventId, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1031 | LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, |
| 1032 | readableData, |
| 1033 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1034 | MESSAGE("INPUT WORKLOAD EXECUTION - END OF LIFE EVENT RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1035 | |
| 1036 | // Conv2d workload execution |
| 1037 | // Conv2d workload execution entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1038 | ProfilingGuid conv2DWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData( |
| 1039 | EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1040 | MESSAGE("CONV2D WORKLOAD EXECUTION ENTITY OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1041 | |
| 1042 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1043 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 1044 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1045 | conv2DWorkloadExecutionGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1046 | LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1047 | LabelsAndEventClasses::TYPE_GUID, |
| 1048 | readableData, |
| 1049 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1050 | MESSAGE("CONV2D WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1051 | |
| 1052 | // Inference - Workload execution relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1053 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 1054 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1055 | inferenceGuid, |
| 1056 | conv2DWorkloadExecutionGuid, |
| 1057 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1058 | readableData, |
| 1059 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1060 | MESSAGE("INFERENCE - CONV2D WORKLOAD EXECUTION CHILD RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1061 | |
| 1062 | // Workload - Workload execution relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1063 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 1064 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1065 | conv2DWorkloadGuid, |
| 1066 | conv2DWorkloadExecutionGuid, |
| 1067 | LabelsAndEventClasses::EXECUTION_OF_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1068 | readableData, |
| 1069 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1070 | MESSAGE("CONV2D WORKLOAD - CONV2D WORKLOAD EXECUTION RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1071 | |
| 1072 | // Start Conv2d workload execution life |
| 1073 | // Event packet - timeline, threadId, eventGuid |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1074 | ProfilingGuid conv2DWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket( |
| 1075 | EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1076 | MESSAGE("CONV2D WORKLOAD EXECUTION START OF LIFE EVENT OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1077 | |
| 1078 | // Conv2d workload execution - event relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1079 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 1080 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1081 | conv2DWorkloadExecutionGuid, |
| 1082 | conv2DWorkloadExecutionSOLEventGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1083 | LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, |
| 1084 | readableData, |
| 1085 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1086 | MESSAGE("CONV2D WORKLOAD EXECUTION START OF LIFE RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1087 | |
| 1088 | // End of Conv2d workload execution life |
| 1089 | // Event packet - timeline, threadId, eventGuid |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1090 | ProfilingGuid conv2DWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket( |
| 1091 | EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1092 | MESSAGE("CONV2D WORKLOAD EXECUTION END OF LIFE EVENT OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1093 | |
| 1094 | // Conv2d workload execution - event relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1095 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 1096 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1097 | conv2DWorkloadExecutionGuid, |
| 1098 | conv2DWorkloadExecutionEOLEventGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1099 | LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, |
| 1100 | readableData, |
| 1101 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1102 | MESSAGE("CONV2D WORKLOAD EXECUTION END OF LIFE RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1103 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1104 | // Abs workload execution |
| 1105 | // Abs workload execution entity |
| 1106 | ProfilingGuid absWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData( |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1107 | EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1108 | MESSAGE("ABS WORKLOAD EXECUTION ENTITY OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1109 | |
| 1110 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1111 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 1112 | EmptyOptional(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1113 | absWorkloadExecutionGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1114 | LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1115 | LabelsAndEventClasses::TYPE_GUID, |
| 1116 | readableData, |
| 1117 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1118 | MESSAGE("ABS WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1119 | |
| 1120 | // Inference - Workload execution relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1121 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 1122 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1123 | inferenceGuid, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1124 | absWorkloadExecutionGuid, |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1125 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1126 | readableData, |
| 1127 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1128 | MESSAGE("INFERENCE - ABS WORKLOAD EXECUTION CHILD RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1129 | |
| 1130 | // Workload - Workload execution relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1131 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 1132 | EmptyOptional(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1133 | absWorkloadGuid, |
| 1134 | absWorkloadExecutionGuid, |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1135 | LabelsAndEventClasses::EXECUTION_OF_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1136 | readableData, |
| 1137 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1138 | MESSAGE("ABS WORKLOAD - ABS WORKLOAD EXECUTION RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1139 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1140 | // Start Abs workload execution life |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1141 | // Event packet - timeline, threadId, eventGuid |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1142 | ProfilingGuid absWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket( |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1143 | EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1144 | MESSAGE("ABS WORKLOAD EXECUTION START OF LIFE EVENT OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1145 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1146 | // Abs workload execution - event relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1147 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 1148 | EmptyOptional(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1149 | absWorkloadExecutionGuid, |
| 1150 | absWorkloadExecutionSOLEventGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1151 | LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, |
| 1152 | readableData, |
| 1153 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1154 | MESSAGE("ABS WORKLOAD EXECUTION START OF LIFE RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1155 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1156 | // End of Abs workload execution life |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1157 | // Event packet - timeline, threadId, eventGuid |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1158 | ProfilingGuid absWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket( |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1159 | EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1160 | MESSAGE("ABS WORKLOAD EXECUTION END OF LIFE EVENT OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1161 | |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1162 | // Abs workload execution - event relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1163 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 1164 | EmptyOptional(), |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 1165 | absWorkloadExecutionGuid, |
| 1166 | absWorkloadExecutionEOLEventGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1167 | LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, |
| 1168 | readableData, |
| 1169 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1170 | MESSAGE("ABS WORKLOAD EXECUTION END OF LIFE RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1171 | |
| 1172 | // Output workload execution |
| 1173 | // Output workload execution entity |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1174 | ProfilingGuid outputWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData( |
| 1175 | EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1176 | MESSAGE("OUTPUT WORKLOAD EXECUTION ENTITY OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1177 | |
| 1178 | // Entity - Type relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1179 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink, |
| 1180 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1181 | outputWorkloadExecutionGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1182 | LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1183 | LabelsAndEventClasses::TYPE_GUID, |
| 1184 | readableData, |
| 1185 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1186 | MESSAGE("OUTPUT WORKLOAD EXECUTION TYPE RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1187 | |
| 1188 | // Inference - Workload execution relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1189 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 1190 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1191 | inferenceGuid, |
| 1192 | outputWorkloadExecutionGuid, |
| 1193 | LabelsAndEventClasses::CHILD_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1194 | readableData, |
| 1195 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1196 | MESSAGE("INFERENCE - OUTPUT WORKLOAD EXECUTION CHILD RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1197 | |
| 1198 | // Workload - Workload execution relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1199 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink, |
| 1200 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1201 | outputWorkloadGuid, |
| 1202 | outputWorkloadExecutionGuid, |
| 1203 | LabelsAndEventClasses::EXECUTION_OF_GUID, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1204 | readableData, |
| 1205 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1206 | MESSAGE("OUTPUT WORKLOAD - OUTPUT WORKLOAD EXECUTION EXECUTION_OF RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1207 | |
| 1208 | // Start Output workload execution life |
| 1209 | // Event packet - timeline, threadId, eventGuid |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1210 | ProfilingGuid outputWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket( |
| 1211 | EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1212 | MESSAGE("OUTPUT WORKLOAD EXECUTION START OF LIFE EVENT OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1213 | |
| 1214 | // Output workload execution - event relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1215 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 1216 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1217 | outputWorkloadExecutionGuid, |
| 1218 | outputWorkloadExecutionSOLEventGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1219 | LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, |
| 1220 | readableData, |
| 1221 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1222 | MESSAGE("OUTPUT WORKLOAD EXECUTION - START OF LIFE EVENT RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1223 | |
| 1224 | // End of Normalize workload execution life |
| 1225 | // Event packet - timeline, threadId, eventGuid |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1226 | ProfilingGuid outputWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket( |
| 1227 | EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1228 | MESSAGE("OUTPUT WORKLOAD EXECUTION END OF LIFE EVENT OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1229 | |
| 1230 | // Output workload execution - event relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1231 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 1232 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1233 | outputWorkloadExecutionGuid, |
| 1234 | outputWorkloadExecutionEOLEventGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1235 | LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, |
| 1236 | readableData, |
| 1237 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1238 | MESSAGE("OUTPUT WORKLOAD EXECUTION - END OF LIFE EVENT RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1239 | |
| 1240 | // End of Inference life |
| 1241 | // Event packet - timeline, threadId, eventGuid |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1242 | ProfilingGuid inferenceEOLEventGuid = VerifyTimelineEventBinaryPacket( |
| 1243 | EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1244 | MESSAGE("INFERENCE END OF LIFE EVENT OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1245 | |
| 1246 | // Inference - event relationship |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1247 | VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink, |
| 1248 | EmptyOptional(), |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1249 | inferenceGuid, |
| 1250 | inferenceEOLEventGuid, |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 1251 | LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, |
| 1252 | readableData, |
| 1253 | offset); |
Sadik Armagan | 1625efc | 2021-06-10 18:24:34 +0100 | [diff] [blame] | 1254 | MESSAGE("INFERENCE - END OF LIFE EVENT RELATIONSHIP OK"); |
David Monahan | 6198fe0 | 2019-12-02 08:35:43 +0000 | [diff] [blame] | 1255 | |
| 1256 | bufferManager.MarkRead(inferenceReadableBuffer); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 1257 | } |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1258 | |
Jim Flynn | 6398a98 | 2020-05-27 17:05:21 +0100 | [diff] [blame] | 1259 | bool CompareOutput(std::vector<std::string> output, std::vector<std::string> expectedOutput) |
| 1260 | { |
| 1261 | if (output.size() != expectedOutput.size()) |
| 1262 | { |
| 1263 | std::cerr << "output has [" << output.size() << "] lines, expected was [" |
| 1264 | << expectedOutput.size() << "] lines" << std::endl; |
| 1265 | std::cerr << std::endl << "actual" << std::endl << std::endl; |
| 1266 | for (auto line : output) |
| 1267 | { |
| 1268 | std::cerr << line << std::endl; |
| 1269 | } |
| 1270 | std::cerr << std::endl << "expected" << std::endl << std::endl; |
| 1271 | for (auto line : expectedOutput) |
| 1272 | { |
| 1273 | std::cerr << line << std::endl; |
| 1274 | } |
| 1275 | return false; |
| 1276 | } |
| 1277 | bool bRet = true; |
| 1278 | for (unsigned long i = 0; i < output.size(); ++i) |
| 1279 | { |
| 1280 | if (output[i] != expectedOutput[i]) |
| 1281 | { |
| 1282 | bRet = false; |
| 1283 | std::cerr << i << ": actual [" << output[i] << "] expected [" << expectedOutput[i] << "]" << std::endl; |
| 1284 | } |
| 1285 | } |
| 1286 | return bRet; |
| 1287 | } |