diff options
author | David Beck <david.beck@arm.com> | 2018-10-19 15:20:56 +0100 |
---|---|---|
committer | Matthew Bentham <matthew.bentham@arm.com> | 2018-10-22 16:57:54 +0100 |
commit | f0b4845c1c6f24f59d4c88473b852cf69a3c7ae9 (patch) | |
tree | 5a8726ee4a397c421a6a41d6edca1a2d3183f168 /include/armnn/BackendId.hpp | |
parent | 7bc8c9fc9726d3c9ac002138c594688a006faac6 (diff) | |
download | armnn-f0b4845c1c6f24f59d4c88473b852cf69a3c7ae9.tar.gz |
IVGCVSW-2019 : replace Compute enum in the backend preferences list
Change-Id: Ie7549fd27378acfa97e68d098e338b8c9d4ea5d2
Diffstat (limited to 'include/armnn/BackendId.hpp')
-rw-r--r-- | include/armnn/BackendId.hpp | 11 |
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; } |