21 std::vector<uint32_t> headers;
22 headers.push_back(m_DirectoryHeader);
23 headers.push_back(m_MessageHeader);
29 if (packet.GetHeader() == m_DirectoryHeader)
31 ProcessDirectoryPacket(packet);
33 else if (packet.GetHeader() == m_MessageHeader)
35 ProcessMessagePacket(packet);
40 ss <<
"Received a packet with unknown header [" << packet.GetHeader() <<
"]";
47 m_Connection->
Close();
52 std::unique_lock<std::mutex> lck(m_InferenceCompletedMutex);
54 auto start = std::chrono::high_resolution_clock::now();
57 if (!m_InferenceCompletedConditionVariable.wait_for(lck,
58 std::chrono::milliseconds(timeout),
59 [&]{return m_InferenceCompleted == true;}))
61 auto finish = std::chrono::high_resolution_clock::now();
62 std::chrono::duration<double, std::milli> elapsed = finish - start;
64 ss <<
"Timed out waiting on inference completion for " << elapsed.count() <<
" ms";
73 std::unique_lock<std::mutex> lck(m_InferenceCompletedMutex);
74 m_InferenceCompleted =
true;
76 m_InferenceCompletedConditionVariable.notify_one();
79 void TestTimelinePacketHandler::ProcessDirectoryPacket(
const arm::pipe::Packet& packet)
81 m_DirectoryDecoder(packet);
84 void TestTimelinePacketHandler::ProcessMessagePacket(
const arm::pipe::Packet& packet)
93 return arm::pipe::ITimelineDecoder::TimelineStatus::TimelineStatus_Success;
97 const arm::pipe::ITimelineDecoder::EventClass& eventClass)
100 return arm::pipe::ITimelineDecoder::TimelineStatus::TimelineStatus_Success;
104 const arm::pipe::ITimelineDecoder::Event& event)
107 return arm::pipe::ITimelineDecoder::TimelineStatus::TimelineStatus_Success;
111 const arm::pipe::ITimelineDecoder::Label& label)
114 return arm::pipe::ITimelineDecoder::TimelineStatus::TimelineStatus_Success;
118 const arm::pipe::ITimelineDecoder::Relationship& relationship)
129 if (m_PacketHandler !=
nullptr)
131 m_PacketHandler->SetInferenceComplete();
135 return arm::pipe::ITimelineDecoder::TimelineStatus::TimelineStatus_Success;
void AddLabel(const arm::pipe::ITimelineDecoder::Label &label)
Head retains(parents) Tail.
bool IsInferenceGuid(uint64_t guid) const
Copyright (c) 2021 ARM Limited and Contributors.
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_EOL_EVENT_CLASS
void AddEventClass(const arm::pipe::ITimelineDecoder::EventClass &eventClass)
virtual std::vector< uint32_t > GetHeadersAccepted() override
void AddEvent(const arm::pipe::ITimelineDecoder::Event &event)
void AddEntity(uint64_t guid)
virtual TimelineStatus CreateLabel(const Label &) override
virtual TimelineStatus CreateEventClass(const EventClass &) override
virtual TimelineStatus CreateEvent(const Event &) override
void SetInferenceComplete()
virtual TimelineStatus CreateRelationship(const Relationship &) override
Base class for all ArmNN exceptions so that users can filter to just those.
void WaitOnInferenceCompletion(unsigned int timeout)
virtual void HandlePacket(const arm::pipe::Packet &packet) override
process the packet
void AddRelationship(const arm::pipe::ITimelineDecoder::Relationship &relationship)
virtual TimelineStatus CreateEntity(const Entity &) override