aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/PacketBuffer.hpp
blob: a3d95d41087b4aa487b39e230cdb86139ca689a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Copyright © 2019 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#pragma once

#include "IPacketBuffer.hpp"

#include <memory>

namespace armnn
{

namespace profiling
{

class PacketBuffer : public IPacketBuffer
{
public:
    PacketBuffer(unsigned int maxSize);

    ~PacketBuffer() {}

    const unsigned char* const GetReadableData() const  override;

    unsigned int GetSize() const  override;

    void MarkRead() override;

    void Commit(unsigned int size)  override;

    void Release() override;

    unsigned char* GetWritableData() override;

private:
    unsigned int m_MaxSize;
    unsigned int m_Size;
    std::unique_ptr<unsigned char[]> m_Data;
};

} // namespace profiling

} // namespace armnn