aboutsummaryrefslogtreecommitdiff
path: root/include/armnn/profiling/ISendTimelinePacket.hpp
blob: 49a9fcf40eafb2c4724fb1ebae3b58f3bc7d4ab9 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// Copyright © 2019 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#pragma once

#include <algorithm>
#include <string>
#include <thread>
#include <vector>

namespace armnn
{

namespace profiling
{

enum class ProfilingRelationshipType
{
    RetentionLink,    /// Head retains(parents) Tail
    ExecutionLink,    /// Head execution start depends on Tail execution completion
    DataLink,         /// Head uses data of Tail
    LabelLink         /// Head uses label Tail (Tail MUST be a guid of a label).
};

class ISendTimelinePacket
{
public:
    virtual ~ISendTimelinePacket()
    {}

    /// Commits the current buffer and reset the member variables
    virtual void Commit() = 0;

    /// Create and write a TimelineEntityBinaryPacket from the parameters to the buffer.
    virtual void SendTimelineEntityBinaryPacket(uint64_t profilingGuid) = 0;

    /// Create and write a TimelineEventBinaryPacket from the parameters to the buffer.
    virtual void
        SendTimelineEventBinaryPacket(uint64_t timestamp, std::thread::id threadId, uint64_t profilingGuid) = 0;

    /// Create and write a TimelineEventClassBinaryPacket from the parameters to the buffer.
    virtual void SendTimelineEventClassBinaryPacket(uint64_t profilingGuid) = 0;

    /// Create and write a TimelineLabelBinaryPacket from the parameters to the buffer.
    virtual void SendTimelineLabelBinaryPacket(uint64_t profilingGuid, const std::string& label) = 0;

    /// Create and write a TimelineMessageDirectoryPackage in the buffer
    virtual void SendTimelineMessageDirectoryPackage() = 0;

    /// Create and write a TimelineRelationshipBinaryPacket from the parameters to the buffer.
    virtual void SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType relationshipType,
                                                      uint64_t relationshipGuid,
                                                      uint64_t headGuid,
                                                      uint64_t tailGuid) = 0;
};

}    // namespace profiling

}    // namespace armnn