blob: 689abbb082cb3b0d3637811664dc1c38fa2737f8 [file] [log] [blame]
Aron Virginas-Tare898db92019-08-22 12:56:34 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "PacketVersionResolver.hpp"
7
Jan Eilers8eb25602020-03-09 12:13:48 +00008#include <armnn/utility/IgnoreUnused.hpp>
Derek Lamberti1dd75b32019-12-10 21:23:23 +00009
Aron Virginas-Tare898db92019-08-22 12:56:34 +010010namespace armnn
11{
12
13namespace profiling
14{
15
Jim Flynned25e0e2019-10-18 13:21:43 +010016bool PacketKey::operator<(const PacketKey& rhs) const
17{
18 bool result = true;
19 if (m_FamilyId == rhs.m_FamilyId)
20 {
21 result = m_PacketId < rhs.m_PacketId;
22 }
23 else if (m_FamilyId > rhs.m_FamilyId)
24 {
25 result = false;
26 }
27 return result;
28}
29
30bool PacketKey::operator>(const PacketKey& rhs) const
31{
32 return rhs < *this;
33}
34
35bool PacketKey::operator<=(const PacketKey& rhs) const
36{
37 return !(*this > rhs);
38}
39
40bool PacketKey::operator>=(const PacketKey& rhs) const
41{
42 return !(*this < rhs);
43}
44
45bool PacketKey::operator==(const PacketKey& rhs) const
46{
47 return m_FamilyId == rhs.m_FamilyId && m_PacketId == rhs.m_PacketId;
48}
49
50bool PacketKey::operator!=(const PacketKey& rhs) const
51{
52 return !(*this == rhs);
53}
54
55Version PacketVersionResolver::ResolvePacketVersion(uint32_t familyId, uint32_t packetId) const
Aron Virginas-Tare898db92019-08-22 12:56:34 +010056{
Keith Davis33ed2212020-03-30 10:43:41 +010057 const PacketKey packetKey(familyId, packetId);
58
59 if( packetKey == ActivateTimeLinePacket )
60 {
61 return Version(1, 1, 0);
62 }
Finn Williams2ed809c2020-04-20 21:21:07 +010063 if( packetKey == DeactivateTimeLinePacket )
Keith Davis33ed2212020-03-30 10:43:41 +010064 {
65 return Version(1, 1, 0);
66 }
67
Aron Virginas-Tare898db92019-08-22 12:56:34 +010068 return Version(1, 0, 0);
69}
70
71} // namespace profiling
72
73} // namespace armnn