ArmNN
 20.05
SendCounterPacketTests.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <SendCounterPacket.hpp>
9 #include <SendThread.hpp>
10 #include <ProfilingUtils.hpp>
12 
13 #include <armnn/Exceptions.hpp>
14 #include <armnn/Optional.hpp>
15 #include <armnn/Conversion.hpp>
16 #include <armnn/utility/Assert.hpp>
18 
19 #include <boost/numeric/conversion/cast.hpp>
20 
21 #include <atomic>
22 #include <condition_variable>
23 #include <mutex>
24 #include <thread>
25 
26 namespace armnn
27 {
28 
29 namespace profiling
30 {
31 
33 {
34 public:
36  : SendCounterPacket(buffer)
37  {}
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 };
68 
69 } // namespace profiling
70 
71 } // namespace armnn
bool CreateCounterSetRecordTest(const CounterSetPtr &counterSet, CounterSetRecord &counterSetRecord, std::string &errorMessage)
std::vector< uint32_t > CounterSetRecord
bool CreateDeviceRecord(const DevicePtr &device, DeviceRecord &deviceRecord, std::string &errorMessage)
std::unordered_map< uint16_t, CounterPtr > Counters
std::unique_ptr< Device > DevicePtr
bool CreateDeviceRecordTest(const DevicePtr &device, DeviceRecord &deviceRecord, std::string &errorMessage)
std::unique_ptr< CounterSet > CounterSetPtr
Copyright (c) 2020 ARM Limited.
bool CreateEventRecordTest(const CounterPtr &counter, EventRecord &eventRecord, std::string &errorMessage)
std::shared_ptr< Counter > CounterPtr
bool CreateCounterSetRecord(const CounterSetPtr &counterSet, CounterSetRecord &counterSetRecord, std::string &errorMessage)
bool CreateCategoryRecordTest(const CategoryPtr &category, const Counters &counters, CategoryRecord &categoryRecord, std::string &errorMessage)
std::vector< uint32_t > CategoryRecord
std::unique_ptr< Category > CategoryPtr
bool CreateEventRecord(const CounterPtr &counter, EventRecord &eventRecord, std::string &errorMessage)
bool CreateCategoryRecord(const CategoryPtr &category, const Counters &counters, CategoryRecord &categoryRecord, std::string &errorMessage)