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();
45 BOOST_CHECK(readableBuffer !=
nullptr);
46 unsigned int size = readableBuffer->GetSize();
47 BOOST_CHECK(size == 76);
48 const unsigned char* readableData = readableBuffer->GetReadableData();
49 BOOST_CHECK(readableData !=
nullptr);
52 unsigned int offset = 0;
70 mockBufferManager.
MarkRead(readableBuffer);
83 BOOST_CHECK(readableBuffer !=
nullptr);
84 unsigned int size = readableBuffer->GetSize();
85 BOOST_TEST(size == 460);
86 const unsigned char* readableData = readableBuffer->GetReadableData();
87 BOOST_CHECK(readableData !=
nullptr);
90 unsigned int offset = 0;
197 mockBufferManager.
MarkRead(readableBuffer);
204 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
209 const std::string entityName =
"some entity";
210 const std::string entityType =
"some type";
215 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid,
"", entityType),
217 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, entityName,
""),
219 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(
221 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedChildEntity(
224 BOOST_CHECK_NO_THROW(childEntityGuid = timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid,
230 timelineUtilityMethods.Commit();
234 BOOST_CHECK(readableBuffer !=
nullptr);
235 unsigned int size = readableBuffer->GetSize();
236 BOOST_CHECK(size == 196);
237 const unsigned char* readableData = readableBuffer->GetReadableData();
238 BOOST_CHECK(readableData !=
nullptr);
241 unsigned int offset = 0;
284 mockBufferManager.
MarkRead(readableBuffer);
291 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
301 BOOST_CHECK_THROW(timelineUtilityMethods.DeclareLabel(
"inv@lid lab€l"),
RuntimeException);
304 const std::string labelName =
"valid label";
306 BOOST_CHECK_NO_THROW(labelGuid = timelineUtilityMethods.DeclareLabel(labelName));
311 BOOST_CHECK_NO_THROW(newLabelGuid = timelineUtilityMethods.DeclareLabel(labelName));
313 BOOST_CHECK(newLabelGuid == labelGuid);
320 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
332 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid,
"",
"Type"),
336 BOOST_CHECK_THROW(timelineUtilityMethods.CreateNamedTypedEntity(guid,
"Name",
""),
345 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
348 const std::string entityName =
"Entity0";
349 const std::string entityType =
"Type0";
354 ProfilingDynamicGuid guid = timelineUtilityMethods.CreateNamedTypedEntity(entityName, entityType);
358 timelineUtilityMethods.Commit();
362 BOOST_CHECK(readableBuffer !=
nullptr);
363 unsigned int size = readableBuffer->GetSize();
364 BOOST_CHECK(size == 148);
365 const unsigned char* readableData = readableBuffer->GetReadableData();
366 BOOST_CHECK(readableData !=
nullptr);
369 unsigned int offset = 0;
405 mockBufferManager.
MarkRead(readableBuffer);
412 std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = std::make_unique<SendTimelinePacket>(mockBufferManager);
420 BOOST_CHECK_NO_THROW(eventGuid = timelineUtilityMethods.RecordEvent(entityGuid, eventClassGuid));
424 timelineUtilityMethods.Commit();
428 BOOST_CHECK(readableBuffer !=
nullptr);
429 unsigned int size = readableBuffer->GetSize();
433 const unsigned char* readableData = readableBuffer->GetReadableData();
434 BOOST_CHECK(readableData !=
nullptr);
437 unsigned int offset = 0;
455 mockBufferManager.
MarkRead(readableBuffer);
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
static ARMNN_DLLEXPORT ProfilingStaticGuid INFERENCE_GUID
void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, ProfilingGuid nameGuid, const unsigned char *readableData, unsigned int &offset)
static ARMNN_DLLEXPORT std::string WORKLOAD_EXECUTION
ProfilingGuid VerifyTimelineEntityBinaryPacketData(Optional< ProfilingGuid > guid, const unsigned char *readableData, unsigned int &offset)
static ARMNN_DLLEXPORT std::string TYPE_LABEL
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_SOL_EVENT_CLASS_NAME_GUID
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.
Copyright (c) 2020 ARM Limited.
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
static ARMNN_DLLEXPORT std::string EXECUTION_OF_LABEL
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
void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relationshipType, Optional< ProfilingGuid > relationshipGuid, Optional< ProfilingGuid > headGuid, Optional< ProfilingGuid > tailGuid, Optional< ProfilingGuid > attributeGuid, const unsigned char *readableData, unsigned int &offset)
static ARMNN_DLLEXPORT ProfilingStaticGuid EXECUTION_OF_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_EOL_EVENT_CLASS_NAME_GUID
static ARMNN_DLLEXPORT std::string WORKLOAD
IPacketBufferPtr GetReadableBuffer() override
static ARMNN_DLLEXPORT std::string INDEX_LABEL
static ARMNN_DLLEXPORT std::string ARMNN_PROFILING_SOL_EVENT_CLASS_NAME
static ARMNN_DLLEXPORT std::string ARMNN_PROFILING_EOL_EVENT_CLASS_NAME
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
constexpr unsigned int ThreadIdSize
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 std::string PROCESS_ID_LABEL
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...
static ARMNN_DLLEXPORT ProfilingStaticGuid TYPE_GUID
static ARMNN_DLLEXPORT std::string CHILD_LABEL
static void SendWellKnownLabelsAndEventClasses(ISendTimelinePacket &timelinePacket)
ProfilingGuid VerifyTimelineEventBinaryPacket(Optional< uint64_t > timestamp, Optional< int > threadId, Optional< ProfilingGuid > eventGuid, const unsigned char *readableData, unsigned int &offset)
ProfilingGuid VerifyTimelineLabelBinaryPacketData(Optional< ProfilingGuid > guid, const std::string &label, const unsigned char *readableData, unsigned int &offset)
static ARMNN_DLLEXPORT ProfilingStaticGuid PROCESS_ID_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid BACKENDID_GUID
static ARMNN_DLLEXPORT std::string INFERENCE
static ARMNN_DLLEXPORT ProfilingStaticGuid CHILD_GUID
static ARMNN_DLLEXPORT std::string LAYER