16 #include <boost/test/unit_test.hpp> 18 using namespace armnn;
26 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
33 const std::string entityName =
"some entity";
36 BOOST_CHECK_NO_THROW(timelineUtilityMethods.MarkEntityWithLabel(entityGuid, entityName, labelTypeGuid));
39 timelineUtilityMethods.Commit();
44 unsigned int size = readableBuffer->GetSize();
46 const unsigned char* readableData = readableBuffer->GetReadableData();
50 unsigned int offset = 0;
72 mockBufferManager.
MarkRead(readableBuffer);
78 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
81 BOOST_CHECK_NO_THROW(timelineUtilityMethods.SendWellKnownLabelsAndEventClasses());
84 timelineUtilityMethods.Commit();
89 unsigned int size = readableBuffer->GetSize();
90 BOOST_TEST(size == 388);
91 const unsigned char* readableData = readableBuffer->GetReadableData();
95 unsigned int offset = 0;
167 mockBufferManager.
MarkRead(readableBuffer);
173 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
178 const std::string entityName =
"some entity";
179 const std::string entityType =
"some type";
184 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid,
"", entityType),
186 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, entityName,
""),
188 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(
190 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(
193 BOOST_CHECK_NO_THROW(childEntityGuid = timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid,
199 timelineUtilityMethods.Commit();
204 unsigned int size = readableBuffer->GetSize();
206 const unsigned char* readableData = readableBuffer->GetReadableData();
210 unsigned int offset = 0;
262 mockBufferManager.
MarkRead(readableBuffer);
268 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
278 BOOST_CHECK_THROW(timelineUtilityMethods.DeclareLabel(
"inv@lid lab€l"),
RuntimeException);
281 const std::string labelName =
"valid label";
283 BOOST_CHECK_NO_THROW(labelGuid = timelineUtilityMethods.DeclareLabel(labelName));
288 BOOST_CHECK_NO_THROW(newLabelGuid = timelineUtilityMethods.DeclareLabel(labelName));
296 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
308 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid,
"",
"Type"),
312 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid,
"Name",
""),
320 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
323 const std::string entityName =
"Entity0";
324 const std::string entityType =
"Type0";
329 ProfilingDynamicGuid guid = timelineUtilityMethods.CreateNamedTypedEntity(entityName, entityType);
333 timelineUtilityMethods.Commit();
338 unsigned int size = readableBuffer->GetSize();
340 const unsigned char* readableData = readableBuffer->GetReadableData();
344 unsigned int offset = 0;
390 mockBufferManager.
MarkRead(readableBuffer);
396 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
404 BOOST_CHECK_NO_THROW(eventGuid = timelineUtilityMethods.RecordEvent(entityGuid, eventClassGuid));
408 timelineUtilityMethods.Commit();
413 unsigned int size = readableBuffer->GetSize();
415 const unsigned char* readableData = readableBuffer->GetReadableData();
419 unsigned int offset = 0;
441 mockBufferManager.
MarkRead(readableBuffer);
static ARMNN_DLLEXPORT ProfilingStaticGuid INDEX_GUID
static ARMNN_DLLEXPORT std::string INDEX_LABEL
static ARMNN_DLLEXPORT ProfilingStaticGuid WORKLOAD_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid WORKLOAD_EXECUTION_GUID
void VerifyTimelineLabelBinaryPacket(Optional< ProfilingGuid > guid, const std::string &label, const unsigned char *readableData, unsigned int &offset)
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_EOL_EVENT_CLASS
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
void VerifyTimelineEventClassBinaryPacket(ProfilingGuid guid, const unsigned char *readableData, unsigned int &offset)
static ARMNN_DLLEXPORT ProfilingStaticGuid CONNECTION_GUID
static ARMNN_DLLEXPORT std::string NAME_LABEL
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.
static ARMNN_DLLEXPORT std::string WORKLOAD_EXECUTION
Head retains(parents) Tail.
void MarkRead(IPacketBufferPtr &packetBuffer) override
static ARMNN_DLLEXPORT ProfilingStaticGuid INFERENCE_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid TYPE_GUID
static ARMNN_DLLEXPORT std::string BACKENDID_LABEL
void VerifyTimelineRelationshipBinaryPacket(ProfilingRelationshipType relationshipType, Optional< ProfilingGuid > relationshipGuid, Optional< ProfilingGuid > headGuid, Optional< ProfilingGuid > tailGuid, const unsigned char *readableData, unsigned int &offset)
void VerifyTimelineEventBinaryPacket(Optional< uint64_t > timestamp, Optional< std::thread::id > threadId, Optional< ProfilingGuid > eventGuid, const unsigned char *readableData, unsigned int &offset)
static ARMNN_DLLEXPORT ProfilingStaticGuid BACKENDID_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid NETWORK_GUID
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
Head execution start depends on Tail execution completion.
static ARMNN_DLLEXPORT std::string CONNECTION
static ProfilingService & Instance()
static ARMNN_DLLEXPORT ProfilingStaticGuid LAYER_GUID
BOOST_AUTO_TEST_SUITE_END()
IPacketBufferPtr GetReadableBuffer() override
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
Strongly typed guids to distinguish between those generated at runtime, and those that are statically...
static ARMNN_DLLEXPORT std::string WORKLOAD
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_SOL_EVENT_CLASS
static ARMNN_DLLEXPORT std::string TYPE_LABEL
static ARMNN_DLLEXPORT ProfilingStaticGuid NAME_GUID
static ARMNN_DLLEXPORT std::string LAYER
static ARMNN_DLLEXPORT std::string INFERENCE
static ARMNN_DLLEXPORT std::string NETWORK
void VerifyTimelineEntityBinaryPacket(Optional< ProfilingGuid > guid, const unsigned char *readableData, unsigned int &offset)