16 #include <boost/test/unit_test.hpp> 18 using namespace armnn;
28 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
35 const std::string entityName =
"some entity";
38 BOOST_CHECK_NO_THROW(timelineUtilityMethods.MarkEntityWithLabel(entityGuid, entityName, labelTypeGuid));
41 timelineUtilityMethods.Commit();
46 unsigned int size = readableBuffer->GetSize();
48 const unsigned char* readableData = readableBuffer->GetReadableData();
52 unsigned int offset = 0;
77 mockBufferManager.
MarkRead(readableBuffer);
91 unsigned int size = readableBuffer->GetSize();
92 BOOST_TEST(size == 300);
93 const unsigned char* readableData = readableBuffer->GetReadableData();
97 unsigned int offset = 0;
174 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);
280 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
290 BOOST_CHECK_THROW(timelineUtilityMethods.DeclareLabel(
"inv@lid lab€l"),
RuntimeException);
293 const std::string labelName =
"valid label";
295 BOOST_CHECK_NO_THROW(labelGuid = timelineUtilityMethods.DeclareLabel(labelName));
300 BOOST_CHECK_NO_THROW(newLabelGuid = timelineUtilityMethods.DeclareLabel(labelName));
309 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
321 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid,
"",
"Type"),
325 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid,
"Name",
""),
334 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
337 const std::string entityName =
"Entity0";
338 const std::string entityType =
"Type0";
343 ProfilingDynamicGuid guid = timelineUtilityMethods.CreateNamedTypedEntity(entityName, entityType);
347 timelineUtilityMethods.Commit();
352 unsigned int size = readableBuffer->GetSize();
354 const unsigned char* readableData = readableBuffer->GetReadableData();
358 unsigned int offset = 0;
407 mockBufferManager.
MarkRead(readableBuffer);
414 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
422 BOOST_CHECK_NO_THROW(eventGuid = timelineUtilityMethods.RecordEvent(entityGuid, eventClassGuid));
426 timelineUtilityMethods.Commit();
431 unsigned int size = readableBuffer->GetSize();
435 const unsigned char* readableData = readableBuffer->GetReadableData();
439 unsigned int offset = 0;
464 mockBufferManager.
MarkRead(readableBuffer);
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
static ARMNN_DLLEXPORT ProfilingStaticGuid INFERENCE_GUID
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)
constexpr unsigned int ThreadIdSize
armnn::profiling::ProfilingService profilingService
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 void SendWellKnownLabelsAndEventClasses(ISendTimelinePacket &timelinePacket)
static ARMNN_DLLEXPORT ProfilingStaticGuid BACKENDID_GUID
static ARMNN_DLLEXPORT std::string INFERENCE
static ARMNN_DLLEXPORT std::string LAYER