aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Beck <david.beck@arm.com>2018-10-18 15:13:56 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-10-22 16:57:54 +0100
commit33f0ae0d293f5048089f2a04985a8a8bfa1d75a6 (patch)
tree19f27463e524150c26ac75a2ea5c8e6c95f954c6 /include
parentceae3aa1b619161d49fd2847d3c73d6a858b2b8c (diff)
downloadarmnn-33f0ae0d293f5048089f2a04985a8a8bfa1d75a6.tar.gz
IVGCVSW-2019 : replace Compute enum in the Layer object
Change-Id: I76551d511ef718eac36e5b8e5fe426ec3a402855
Diffstat (limited to 'include')
-rw-r--r--include/armnn/BackendId.hpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/armnn/BackendId.hpp b/include/armnn/BackendId.hpp
index af3b7995eb..711833d64e 100644
--- a/include/armnn/BackendId.hpp
+++ b/include/armnn/BackendId.hpp
@@ -70,9 +70,12 @@ inline std::ostream& operator<<(std::ostream& os, const Compute& compute)
return os;
}
+struct UninitializedBackendId {};
+
class BackendId final
{
public:
+ BackendId(UninitializedBackendId) { GetComputeDeviceAsCString(Compute::Undefined); }
BackendId(const std::string& id) : m_Id{id} {}
BackendId(const char* id) : m_Id{id} {}
@@ -102,6 +105,21 @@ public:
return m_Id == other.m_Id;
}
+ // comparison against objects from which the
+ // BackendId can be constructed
+ template <typename O>
+ bool operator==(const O& other) const
+ {
+ BackendId temp{other};
+ return *this == temp;
+ }
+
+ template <typename O>
+ bool operator!=(const O& other) const
+ {
+ return !(*this == other);
+ }
+
bool operator<(const BackendId& other) const
{
return m_Id < other.m_Id;