aboutsummaryrefslogtreecommitdiff
path: root/include/armnn/BackendId.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/armnn/BackendId.hpp')
-rw-r--r--include/armnn/BackendId.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/armnn/BackendId.hpp b/include/armnn/BackendId.hpp
index 711833d64e..72248bca34 100644
--- a/include/armnn/BackendId.hpp
+++ b/include/armnn/BackendId.hpp
@@ -75,6 +75,7 @@ struct UninitializedBackendId {};
class BackendId final
{
public:
+ BackendId() { GetComputeDeviceAsCString(Compute::Undefined); }
BackendId(UninitializedBackendId) { GetComputeDeviceAsCString(Compute::Undefined); }
BackendId(const std::string& id) : m_Id{id} {}
BackendId(const char* id) : m_Id{id} {}
@@ -128,17 +129,21 @@ public:
const std::string& Get() const { return m_Id; }
private:
- // backend Id mustn't be empty:
- BackendId() = delete;
std::string m_Id;
};
+inline std::ostream& operator<<(std::ostream& os, const BackendId& id)
+{
+ os << id.Get();
+ return os;
+}
+
template <template <class...> class TContainer>
inline std::ostream& operator<<(std::ostream& os,
const TContainer<BackendId>& ids)
{
os << '[';
- for (const auto& id : ids) { os << id.Get() << " "; }
+ for (const auto& id : ids) { os << id << " "; }
os << ']';
return os;
}