blob: 4d7e11a7e0641d485d7a4a36a45a238bdecde737 [file] [log] [blame]
Francis Murtagh1f7db452019-08-14 09:49:34 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "CommandHandlerKey.hpp"
7
Aron Virginas-Tare898db92019-08-22 12:56:34 +01008namespace armnn
9{
10
11namespace profiling
12{
13
Jim Flynn397043f2019-10-17 17:37:10 +010014uint32_t CommandHandlerKey::GetFamilyId() const
15{
16 return m_FamilyId;
17}
18
Francis Murtagh1f7db452019-08-14 09:49:34 +010019uint32_t CommandHandlerKey::GetPacketId() const
20{
21 return m_PacketId;
22}
23
24uint32_t CommandHandlerKey::GetVersion() const
25{
26 return m_Version;
27}
28
29bool CommandHandlerKey::operator<(const CommandHandlerKey& rhs) const
30{
31 bool result = true;
Jim Flynn397043f2019-10-17 17:37:10 +010032 if (m_FamilyId == rhs.m_FamilyId)
Francis Murtagh1f7db452019-08-14 09:49:34 +010033 {
Jim Flynn397043f2019-10-17 17:37:10 +010034 if (m_PacketId == rhs.m_PacketId)
35 {
36 result = m_Version < rhs.m_Version;
37 }
38 else if (m_PacketId > rhs.m_PacketId)
39 {
40 result = false;
41 }
Francis Murtagh1f7db452019-08-14 09:49:34 +010042 }
Jim Flynn397043f2019-10-17 17:37:10 +010043 else if (m_FamilyId > rhs.m_FamilyId)
Francis Murtagh1f7db452019-08-14 09:49:34 +010044 {
45 result = false;
46 }
Francis Murtagh1f7db452019-08-14 09:49:34 +010047 return result;
48}
49
50bool CommandHandlerKey::operator>(const CommandHandlerKey& rhs) const
51{
52 return rhs < *this;
53}
54
55bool CommandHandlerKey::operator<=(const CommandHandlerKey& rhs) const
56{
57 return !(*this > rhs);
58}
59
60bool CommandHandlerKey::operator>=(const CommandHandlerKey& rhs) const
61{
62 return !(*this < rhs);
63}
64
65bool CommandHandlerKey::operator==(const CommandHandlerKey& rhs) const
66{
Jim Flynn397043f2019-10-17 17:37:10 +010067 return m_FamilyId == rhs.m_FamilyId && m_PacketId == rhs.m_PacketId && m_Version == rhs.m_Version;
Francis Murtagh1f7db452019-08-14 09:49:34 +010068}
69
70bool CommandHandlerKey::operator!=(const CommandHandlerKey& rhs) const
71{
72 return !(*this == rhs);
73}
Aron Virginas-Tare898db92019-08-22 12:56:34 +010074
75} // namespace profiling
76
77} // namespace armnn