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;
75 mockBufferManager.
MarkRead(readableBuffer);
81 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
84 BOOST_CHECK_NO_THROW(timelineUtilityMethods.SendWellKnownLabelsAndEventClasses());
87 timelineUtilityMethods.Commit();
92 unsigned int size = readableBuffer->GetSize();
93 BOOST_TEST(size == 300);
94 const unsigned char* readableData = readableBuffer->GetReadableData();
98 unsigned int offset = 0;
175 mockBufferManager.
MarkRead(readableBuffer);
181 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
186 const std::string entityName =
"some entity";
187 const std::string entityType =
"some type";
192 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid,
"", entityType),
194 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, entityName,
""),
196 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(
198 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(
201 BOOST_CHECK_NO_THROW(childEntityGuid = timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid,
207 timelineUtilityMethods.Commit();
212 unsigned int size = readableBuffer->GetSize();
214 const unsigned char* readableData = readableBuffer->GetReadableData();
218 unsigned int offset = 0;
273 mockBufferManager.
MarkRead(readableBuffer);
279 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
289 BOOST_CHECK_THROW(timelineUtilityMethods.DeclareLabel(
"inv@lid lab€l"),
RuntimeException);
292 const std::string labelName =
"valid label";
294 BOOST_CHECK_NO_THROW(labelGuid = timelineUtilityMethods.DeclareLabel(labelName));
299 BOOST_CHECK_NO_THROW(newLabelGuid = timelineUtilityMethods.DeclareLabel(labelName));
307 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
319 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid,
"",
"Type"),
323 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid,
"Name",
""),
331 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
334 const std::string entityName =
"Entity0";
335 const std::string entityType =
"Type0";
340 ProfilingDynamicGuid guid = timelineUtilityMethods.CreateNamedTypedEntity(entityName, entityType);
344 timelineUtilityMethods.Commit();
349 unsigned int size = readableBuffer->GetSize();
351 const unsigned char* readableData = readableBuffer->GetReadableData();
355 unsigned int offset = 0;
404 mockBufferManager.
MarkRead(readableBuffer);
410 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
418 BOOST_CHECK_NO_THROW(eventGuid = timelineUtilityMethods.RecordEvent(entityGuid, eventClassGuid));
422 timelineUtilityMethods.Commit();
427 unsigned int size = readableBuffer->GetSize();
429 const unsigned char* readableData = readableBuffer->GetReadableData();
433 unsigned int offset = 0;
458 mockBufferManager.
MarkRead(readableBuffer);
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
static ARMNN_DLLEXPORT ProfilingStaticGuid INFERENCE_GUID
static ProfilingService & Instance()
static ARMNN_DLLEXPORT std::string WORKLOAD_EXECUTION
void VerifyTimelineEntityBinaryPacketData(Optional< ProfilingGuid > guid, const unsigned char *readableData, unsigned int &offset)
static ARMNN_DLLEXPORT std::string TYPE_LABEL
Strongly typed guids to distinguish between those generated at runtime, and those that are statically...
static ARMNN_DLLEXPORT std::string NAME_LABEL
Head retains(parents) Tail.
void VerifyTimelineLabelBinaryPacketData(Optional< ProfilingGuid > guid, const std::string &label, const unsigned char *readableData, unsigned int &offset)
Copyright (c) 2020 ARM Limited.
Head execution start depends on Tail execution completion.
static ARMNN_DLLEXPORT std::string BACKENDID_LABEL
static ARMNN_DLLEXPORT ProfilingStaticGuid CONNECTION_GUID
ProfilingDynamicGuid NextGuid() override
Return the next random Guid in the sequence.
static ARMNN_DLLEXPORT ProfilingStaticGuid WORKLOAD_GUID
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
static ARMNN_DLLEXPORT ProfilingStaticGuid WORKLOAD_EXECUTION_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_EOL_EVENT_CLASS
static ARMNN_DLLEXPORT ProfilingStaticGuid NAME_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_SOL_EVENT_CLASS
static ARMNN_DLLEXPORT std::string NETWORK
void MarkRead(IPacketBufferPtr &packetBuffer) override
static ARMNN_DLLEXPORT ProfilingStaticGuid LAYER_GUID
static ARMNN_DLLEXPORT std::string WORKLOAD
IPacketBufferPtr GetReadableBuffer() override
static ARMNN_DLLEXPORT std::string INDEX_LABEL
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
void VerifyTimelineHeaderBinary(const unsigned char *readableData, unsigned int &offset, uint32_t packetDataLength)
static ARMNN_DLLEXPORT ProfilingStaticGuid NETWORK_GUID
static ARMNN_DLLEXPORT std::string CONNECTION
BOOST_AUTO_TEST_SUITE_END()
static ARMNN_DLLEXPORT ProfilingStaticGuid INDEX_GUID
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, const unsigned char *readableData, unsigned int &offset)
void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relationshipType, Optional< ProfilingGuid > relationshipGuid, Optional< ProfilingGuid > headGuid, Optional< ProfilingGuid > tailGuid, const unsigned char *readableData, unsigned int &offset)
static ARMNN_DLLEXPORT ProfilingStaticGuid TYPE_GUID
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 std::string INFERENCE
static ARMNN_DLLEXPORT std::string LAYER