aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/SendCounterPacketTests.hpp
blob: 1985bc802c6e8fd37e5b1fea3597cfa2c100c2e2 (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
62
63
64
65
66
67
68
69
70
71
//
// Copyright © 2019 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//

#pragma once

#include <client/src/SendCounterPacket.hpp>
#include <client/src/SendThread.hpp>
#include <client/src/ProfilingUtils.hpp>
#include <client/src/IProfilingConnectionFactory.hpp>

#include <armnn/profiling/ArmNNProfiling.hpp>

#include <common/include/IgnoreUnused.hpp>
#include <common/include/NumericCast.hpp>

#include <atomic>
#include <condition_variable>
#include <mutex>
#include <thread>

namespace arm
{

namespace pipe
{

class SendCounterPacketTest : public SendCounterPacket
{
public:
    SendCounterPacketTest(IBufferManager& buffer)
        : SendCounterPacket(buffer,
                            arm::pipe::ARMNN_SOFTWARE_INFO,
                            arm::pipe::ARMNN_SOFTWARE_VERSION,
                            arm::pipe::ARMNN_HARDWARE_VERSION)
    {}

    bool CreateDeviceRecordTest(const DevicePtr& device,
                                DeviceRecord& deviceRecord,
                                std::string& errorMessage)
    {
        return CreateDeviceRecord(device, deviceRecord, errorMessage);
    }

    bool CreateCounterSetRecordTest(const CounterSetPtr& counterSet,
                                    CounterSetRecord& counterSetRecord,
                                    std::string& errorMessage)
    {
        return CreateCounterSetRecord(counterSet, counterSetRecord, errorMessage);
    }

    bool CreateEventRecordTest(const CounterPtr& counter,
                               EventRecord& eventRecord,
                               std::string& errorMessage)
    {
        return CreateEventRecord(counter, eventRecord, errorMessage);
    }

    bool CreateCategoryRecordTest(const CategoryPtr& category,
                                  const Counters& counters,
                                  CategoryRecord& categoryRecord,
                                  std::string& errorMessage)
    {
        return CreateCategoryRecord(category, counters, categoryRecord, errorMessage);
    }
};

} // namespace pipe

} // namespace arm