diff options
Diffstat (limited to 'include/armnn/backends')
-rw-r--r-- | include/armnn/backends/IBackendContext.hpp | 7 | ||||
-rw-r--r-- | include/armnn/backends/IBackendInternal.hpp | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/armnn/backends/IBackendContext.hpp b/include/armnn/backends/IBackendContext.hpp index b12c99f733..ae85b6354b 100644 --- a/include/armnn/backends/IBackendContext.hpp +++ b/include/armnn/backends/IBackendContext.hpp @@ -4,6 +4,7 @@ // #pragma once +#include <armnn/BackendOptions.hpp> #include <armnn/IRuntime.hpp> #include <memory> @@ -29,4 +30,10 @@ public: using IBackendContextUniquePtr = std::unique_ptr<IBackendContext>; +class IBackendModelContext +{ +public: + virtual ~IBackendModelContext() {} +}; + } // namespace armnn
\ No newline at end of file diff --git a/include/armnn/backends/IBackendInternal.hpp b/include/armnn/backends/IBackendInternal.hpp index 6771e7b9f5..ee9cb49562 100644 --- a/include/armnn/backends/IBackendInternal.hpp +++ b/include/armnn/backends/IBackendInternal.hpp @@ -86,6 +86,8 @@ public: using Optimizations = std::vector<OptimizationPtr>; using ILayerSupportSharedPtr = std::shared_ptr<ILayerSupport>; + using IBackendSpecificModelContextPtr = std::shared_ptr<IBackendModelContext>; + using IMemoryManagerUniquePtr = std::unique_ptr<IMemoryManager>; using IMemoryManagerSharedPtr = std::shared_ptr<IMemoryManager>; @@ -125,12 +127,23 @@ public: /// The default implementation always returns a default-constructed pointer. virtual IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const; + virtual IBackendSpecificModelContextPtr CreateBackendSpecificModelContext(const ModelOptions& modelOptions) const; + /// Create context specifically used for profiling interaction from backends. virtual IBackendProfilingContextPtr CreateBackendProfilingContext(const IRuntime::CreationOptions& creationOptions, IBackendProfilingPtr& backendProfiling); virtual ILayerSupportSharedPtr GetLayerSupport() const = 0; + virtual ILayerSupportSharedPtr GetLayerSupport(const ModelOptions& modelOptions) const + { + if (modelOptions.empty()) + { + return GetLayerSupport(); + } + return GetLayerSupport(modelOptions); + } + virtual OptimizationViews OptimizeSubgraphView(const SubgraphView& subgraph) const; bool SupportsTensorAllocatorAPI() const; |