Nikhil Raj | bc62605 | 2019-08-15 15:49:45 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #pragma once |
| 6 | |
Aron Virginas-Tar | e898db9 | 2019-08-22 12:56:34 +0100 | [diff] [blame^] | 7 | #include <armnn/Exceptions.hpp> |
Nikhil Raj | bc62605 | 2019-08-15 15:49:45 +0100 | [diff] [blame] | 8 | |
| 9 | #include <boost/log/trivial.hpp> |
| 10 | |
Aron Virginas-Tar | e898db9 | 2019-08-22 12:56:34 +0100 | [diff] [blame^] | 11 | namespace armnn |
| 12 | { |
| 13 | |
| 14 | namespace profiling |
| 15 | { |
Nikhil Raj | bc62605 | 2019-08-15 15:49:45 +0100 | [diff] [blame] | 16 | |
| 17 | class Packet |
| 18 | { |
| 19 | public: |
| 20 | Packet(uint32_t header, uint32_t length, const char* data) |
| 21 | : m_Header(header), m_Length(length), m_Data(data) |
| 22 | { |
| 23 | m_PacketId = ((header >> 16) & 1023); |
| 24 | m_PacketFamily = (header >> 26); |
| 25 | |
| 26 | if (length == 0) |
| 27 | { |
| 28 | if (m_Data != nullptr) |
| 29 | { |
| 30 | throw armnn::Exception("Data should be null"); |
| 31 | } |
| 32 | } |
| 33 | }; |
| 34 | |
| 35 | uint32_t GetHeader() const; |
| 36 | uint32_t GetPacketFamily() const; |
| 37 | uint32_t GetPacketId() const; |
| 38 | uint32_t GetLength() const; |
| 39 | const char* GetData(); |
| 40 | |
| 41 | uint32_t GetPacketClass() const; |
| 42 | uint32_t GetPacketType() const; |
| 43 | |
| 44 | private: |
| 45 | uint32_t m_Header; |
| 46 | uint32_t m_PacketFamily; |
| 47 | uint32_t m_PacketId; |
| 48 | uint32_t m_Length; |
| 49 | const char* m_Data; |
Aron Virginas-Tar | e898db9 | 2019-08-22 12:56:34 +0100 | [diff] [blame^] | 50 | }; |
| 51 | |
| 52 | } // namespace profiling |
| 53 | |
| 54 | } // namespace armnn |