blob: 869f09e63530637b29f2e08193ab74af81199d80 [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
Derek Lamberti1dd75b32019-12-10 21:23:23 +00008#include <boost/core/ignore_unused.hpp>
9
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{
Derek Lamberti1dd75b32019-12-10 21:23:23 +000057 boost::ignore_unused(familyId, packetId);
Aron Virginas-Tare898db92019-08-22 12:56:34 +010058 // NOTE: For now every packet specification is at version 1.0.0
59 return Version(1, 0, 0);
60}
61
62} // namespace profiling
63
64} // namespace armnn