blob: ef8f63de0f0918defbbf298c04165cf3d3124654 [file] [log] [blame]
Ferran Balaguer1b941722019-08-28 16:57:18 +01001//
Jim Flynn83d08a92020-07-09 13:48:16 +01002// Copyright © 2019 Arm Ltd and Contributors. All rights reserved.
Ferran Balaguer1b941722019-08-28 16:57:18 +01003// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
Matteo Martincigh24e8f922019-09-19 11:57:46 +01008#include <SendCounterPacket.hpp>
Sadik Armagan3896b472020-02-10 12:24:15 +00009#include <SendThread.hpp>
Matteo Martincigh24e8f922019-09-19 11:57:46 +010010#include <ProfilingUtils.hpp>
Matteo Martincighe8485382019-10-10 14:08:21 +010011#include <IProfilingConnectionFactory.hpp>
Ferran Balaguer1b941722019-08-28 16:57:18 +010012
13#include <armnn/Exceptions.hpp>
Matteo Martincigh24e8f922019-09-19 11:57:46 +010014#include <armnn/Optional.hpp>
15#include <armnn/Conversion.hpp>
Narumol Prangnawaratac2770a2020-04-01 16:51:23 +010016#include <armnn/utility/Assert.hpp>
Jan Eilers8eb25602020-03-09 12:13:48 +000017#include <armnn/utility/IgnoreUnused.hpp>
Ferran Balaguer1b941722019-08-28 16:57:18 +010018
Matteo Martincigh24e8f922019-09-19 11:57:46 +010019#include <boost/numeric/conversion/cast.hpp>
Ferran Balaguer1b941722019-08-28 16:57:18 +010020
Sadik Armagan3896b472020-02-10 12:24:15 +000021#include <atomic>
22#include <condition_variable>
23#include <mutex>
24#include <thread>
25
Matteo Martincigh24e8f922019-09-19 11:57:46 +010026namespace armnn
27{
Ferran Balaguer1b941722019-08-28 16:57:18 +010028
Matteo Martincigh24e8f922019-09-19 11:57:46 +010029namespace profiling
30{
Matteo Martincighd0613b52019-10-09 16:47:04 +010031
Matteo Martincigh42f9d9e2019-09-05 12:02:04 +010032class SendCounterPacketTest : public SendCounterPacket
33{
34public:
Sadik Armagan3896b472020-02-10 12:24:15 +000035 SendCounterPacketTest(IBufferManager& buffer)
36 : SendCounterPacket(buffer)
Matteo Martincigh42f9d9e2019-09-05 12:02:04 +010037 {}
38
39 bool CreateDeviceRecordTest(const DevicePtr& device,
40 DeviceRecord& deviceRecord,
41 std::string& errorMessage)
42 {
43 return CreateDeviceRecord(device, deviceRecord, errorMessage);
44 }
45
46 bool CreateCounterSetRecordTest(const CounterSetPtr& counterSet,
47 CounterSetRecord& counterSetRecord,
48 std::string& errorMessage)
49 {
50 return CreateCounterSetRecord(counterSet, counterSetRecord, errorMessage);
51 }
52
53 bool CreateEventRecordTest(const CounterPtr& counter,
54 EventRecord& eventRecord,
55 std::string& errorMessage)
56 {
57 return CreateEventRecord(counter, eventRecord, errorMessage);
58 }
59
60 bool CreateCategoryRecordTest(const CategoryPtr& category,
61 const Counters& counters,
62 CategoryRecord& categoryRecord,
63 std::string& errorMessage)
64 {
65 return CreateCategoryRecord(category, counters, categoryRecord, errorMessage);
66 }
67};
Matteo Martincigh24e8f922019-09-19 11:57:46 +010068
69} // namespace profiling
70
71} // namespace armnn