diff options
author | Jim Flynn <jim.flynn@arm.com> | 2022-03-23 23:01:26 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2022-03-23 23:43:35 +0000 |
commit | 3e9bc19ad523361e6b18057849e30c0c48183915 (patch) | |
tree | b7b012a9734ce39d054fc5d92302780fd838e5c8 /src/profiling/PacketBuffer.cpp | |
parent | 277618302d0f131eac0b6ac2015dd3eb09aa6ff9 (diff) | |
download | armnn-3e9bc19ad523361e6b18057849e30c0c48183915.tar.gz |
IVGCVSW-6706 Create the libpipeClient library
Change-Id: I2368aade38ad3808fab55d8a86cd659d4e95d91e
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/profiling/PacketBuffer.cpp')
-rw-r--r-- | src/profiling/PacketBuffer.cpp | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/profiling/PacketBuffer.cpp b/src/profiling/PacketBuffer.cpp deleted file mode 100644 index 3b5fd3570b..0000000000 --- a/src/profiling/PacketBuffer.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright © 2019 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// - -#include "PacketBuffer.hpp" - -#include <common/include/ProfilingException.hpp> - -namespace arm -{ - -namespace pipe -{ - -PacketBuffer::PacketBuffer(unsigned int maxSize) - : m_MaxSize(maxSize) - , m_Size(0) -{ - m_Data = std::make_unique<unsigned char[]>(m_MaxSize); -} - -const unsigned char* PacketBuffer::GetReadableData() const -{ - return m_Data.get(); -} - -unsigned int PacketBuffer::GetSize() const -{ - return m_Size; -} - -void PacketBuffer::MarkRead() -{ - m_Size = 0; -} - -void PacketBuffer::Commit(unsigned int size) -{ - if (size > m_MaxSize) - { - throw arm::pipe::ProfilingException("Cannot commit [" + std::to_string(size) + - "] bytes which is more than the maximum size of the buffer [" + std::to_string(m_MaxSize) + "]"); - } - m_Size = size; -} - -void PacketBuffer::Release() -{ - m_Size = 0; -} - -unsigned char* PacketBuffer::GetWritableData() -{ - return m_Data.get(); -} - -void PacketBuffer::Destroy() -{ - m_Data.reset(nullptr); - m_Size = 0; - m_MaxSize = 0; -} - -} // namespace pipe - -} // namespace arm |