MCPcopy Create free account
hub / github.com/ARM-software/armnn / ForwardWriteBinaryFunction

Method ForwardWriteBinaryFunction

profiling/client/src/SendTimelinePacket.hpp:79–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77
78template<typename Func, typename ... Params>
79void SendTimelinePacket::ForwardWriteBinaryFunction(Func& func, Params&& ... params)
80{
81 try
82 {
83 ReserveBuffer();
84 ARM_PIPE_ASSERT(m_WriteBuffer);
85 unsigned int numberOfBytesWritten = 0;
86 // Header will be prepended to the buffer on Commit()
87 while ( true )
88 {
89 TimelinePacketStatus result = func(std::forward<Params>(params)...,
90 &m_WriteBuffer->GetWritableData()[m_Offset],
91 m_RemainingBufferSize,
92 numberOfBytesWritten);
93 switch ( result )
94 {
95 case TimelinePacketStatus::BufferExhaustion:
96 Commit();
97 ReserveBuffer();
98 continue;
99
100 case TimelinePacketStatus::Error:
101 throw arm::pipe::ProfilingException("Error processing while sending TimelineBinaryPacket",
102 LOCATION());
103
104 default:
105 m_Offset += numberOfBytesWritten;
106 m_RemainingBufferSize -= numberOfBytesWritten;
107 return;
108 }
109 }
110 }
111 catch (const arm::pipe::BufferExhaustion& ex)
112 {
113 // ditto
114 throw ex;
115 }
116 catch (const arm::pipe::ProfilingException& ex)
117 {
118 // don't swallow in the catch all block
119 throw ex;
120 }
121 catch ( ... )
122 {
123 throw arm::pipe::ProfilingException("Unknown Exception thrown while sending TimelineBinaryPacket", LOCATION());
124 }
125}
126
127} // namespace pipe
128

Callers

nothing calls this directly

Calls 2

ProfilingExceptionClass · 0.85
GetWritableDataMethod · 0.45

Tested by

no test coverage detected