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

Method ReserveBuffer

profiling/client/src/SendTimelinePacket.cpp:53–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void SendTimelinePacket::ReserveBuffer()
54{
55 if (m_WriteBuffer != nullptr)
56 {
57 // Buffer already reserved
58 return;
59 }
60
61 uint32_t reserved = 0;
62
63 // Reserve the buffer
64 m_WriteBuffer = m_BufferManager.Reserve(MAX_METADATA_PACKET_LENGTH, reserved);
65
66 // Check if there is enough space in the buffer
67 if (m_WriteBuffer == nullptr)
68 {
69 throw arm::pipe::BufferExhaustion("No free buffers left", LOCATION());
70 }
71 if (reserved < m_Offset)
72 {
73 throw arm::pipe::BufferExhaustion("Reserved space too small for use", LOCATION());
74 }
75
76 if (m_DirectoryPackage)
77 {
78 m_RemainingBufferSize = reserved;
79 return;
80 }
81 // Account for the header size which is added at Commit()
82 m_RemainingBufferSize = reserved - 8;
83}
84
85void SendTimelinePacket::SendTimelineEntityBinaryPacket(uint64_t profilingGuid)
86{

Callers

nothing calls this directly

Calls 2

BufferExhaustionClass · 0.85
ReserveMethod · 0.45

Tested by

no test coverage detected