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 | |
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')
-rw-r--r-- | include/armnn/ArmNN.hpp | 1 | ||||
-rw-r--r-- | include/armnn/BackendId.hpp | 11 | ||||
-rw-r--r-- | include/armnn/INetwork.hpp | 12 |
3 files changed, 15 insertions, 9 deletions
diff --git a/include/armnn/ArmNN.hpp b/include/armnn/ArmNN.hpp index c14b958061..6fe8b188e0 100644 --- a/include/armnn/ArmNN.hpp +++ b/include/armnn/ArmNN.hpp @@ -4,6 +4,7 @@ // #pragma once +#include "BackendId.hpp" #include "Descriptors.hpp" #include "Exceptions.hpp" #include "IRuntime.hpp" 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; } diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index aaf49a3d47..7a809350cb 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -4,12 +4,12 @@ // #pragma once -#include "armnn/NetworkFwd.hpp" -#include "armnn/DescriptorsFwd.hpp" -#include "armnn/TensorFwd.hpp" -#include "armnn/Optional.hpp" +#include <armnn/NetworkFwd.hpp> +#include <armnn/DescriptorsFwd.hpp> +#include <armnn/TensorFwd.hpp> +#include <armnn/Optional.hpp> -#include "armnn/Types.hpp" +#include <armnn/Types.hpp> #include <memory> #include <vector> @@ -339,7 +339,7 @@ struct OptimizerOptions /// armnn::Exception if process fails. IOptimizedNetworkPtr Optimize(const INetwork& network, - const std::vector<armnn::Compute>& backendPreferences, + const std::vector<BackendId>& backendPreferences, const IDeviceSpec& deviceSpec, const OptimizerOptions& options = OptimizerOptions(), Optional<std::vector<std::string>&> errMessages = EmptyOptional()); |