diff options
author | Finn Williams <Finn.Williams@arm.com> | 2021-05-26 18:38:12 +0100 |
---|---|---|
committer | Finn Williams <Finn.Williams@arm.com> | 2021-06-09 17:18:10 +0100 |
commit | b9af86ea42568ade799ee5529137e4756977b6c6 (patch) | |
tree | 261003078fd2191b22ee7465e07668cbed666553 /include/armnn/BackendHelper.hpp | |
parent | 5b1bcc93820b442bc4035c1e030a8d4a0983df91 (diff) | |
download | armnn-b9af86ea42568ade799ee5529137e4756977b6c6.tar.gz |
IVGCVSW-5855 Refactor the reporting of capabilities from backends
Signed-off-by: Finn Williams <Finn.Williams@arm.com>
Change-Id: I05fc331a8e91bdcb6b8a2f32cfb555060fc5d797
Diffstat (limited to 'include/armnn/BackendHelper.hpp')
-rw-r--r-- | include/armnn/BackendHelper.hpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/armnn/BackendHelper.hpp b/include/armnn/BackendHelper.hpp index 5eadab5e20..527d865694 100644 --- a/include/armnn/BackendHelper.hpp +++ b/include/armnn/BackendHelper.hpp @@ -6,6 +6,7 @@ #pragma once #include <armnn/BackendId.hpp> +#include <armnn/BackendOptions.hpp> #include <armnn/backends/ILayerSupport.hpp> #include <armnn/Types.hpp> @@ -436,7 +437,32 @@ private: /// Convenience function to retrieve the ILayerSupportHandle for a backend LayerSupportHandle GetILayerSupportByBackendId(const armnn::BackendId& backend); +/// Convenience function to check if a capability exists in a BackendCapabilites struct +bool HasCapability(const std::string& name,const BackendCapabilities& capabilities); + +/// Convenience function to check if a capability exists in a backend +bool HasCapability(const std::string& name, const armnn::BackendId& backend); + +/// Convenience function to check if a given capability matches a capability in a BackendCapabilities struct +bool HasCapability(const BackendOptions::BackendOption& capability, const BackendCapabilities& capabilities); + +/// Convenience function to check if a given capability matches a capability in a backend +bool HasCapability(const BackendOptions::BackendOption& backendOption, const armnn::BackendId& backend); + +/// Returns a BackendCapability if the backend lists the capability +/// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported +/// Otherwise returns an EmptyOptional if the BackendCapability is unlisted +Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName, + const BackendCapabilities& capabilities); + +/// Returns a BackendCapability if the backend lists the capability +/// The BackendCapability must then be inspected to check whether or not that BackendCapability is supported +/// Otherwise returns an EmptyOptional if the BackendCapability is unlisted +Optional<const BackendOptions::BackendOption> GetCapability(const std::string& backendCapabilityName, + const armnn::BackendId& backend); + /// Convenience function to check a capability on a backend +ARMNN_DEPRECATED_MSG("This function has been deprecated in favour of GetBackendCapability") bool IsCapabilitySupported(const armnn::BackendId& backend, armnn::BackendCapability capability); } |