20 #include <client/include/backends/IBackendProfiling.hpp>
21 #include <client/include/backends/IBackendProfilingContext.hpp>
28 class IWorkloadFactory;
48 return this == &other ||
49 (this->m_Major == other.
m_Major &&
50 this->m_Minor == other.
m_Minor);
55 return this->m_Major < other.
m_Major ||
56 (this->m_Major == other.
m_Major &&
57 this->m_Minor <= other.
m_Minor);
62 return this->m_Major > other.
m_Major ||
63 (this->m_Major == other.
m_Major &&
64 this->m_Minor >= other.
m_Minor);
70 os <<
"[" << backendVersion.
m_Major <<
"." << backendVersion.
m_Minor <<
"]";
186 std::stringstream message;
187 message <<
"The backend " <<
GetId() <<
" doesn't support using a custom allocator. This error might"
188 " be related with the protected mode if the backend doesn't"
189 " fully support it.";
191 errMsg.
value() = message.str();
201 throw armnn::Exception(
"GetDefaultAllocator: Function has not been implemented in backend.");
Base class for all ArmNN exceptions so that users can filter to just those.
Each backend should implement an IBackend.
virtual const BackendId & GetId() const =0
virtual BackendCapabilities GetCapabilities() const
Returns a BackendCapability if the backend lists the capability The BackendCapability must then be in...
virtual IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions &) const
Create the runtime context of the backend.
virtual IMemoryManagerUniquePtr CreateMemoryManager() const
std::shared_ptr< ILayerSupport > ILayerSupportSharedPtr
std::unique_ptr< IMemoryManager > IMemoryManagerUniquePtr
std::unique_ptr< arm::pipe::IBackendProfiling > IBackendProfilingPtr
virtual IBackendSpecificModelContextPtr CreateBackendSpecificModelContext(const ModelOptions &modelOptions) const
std::shared_ptr< IBackendModelContext > IBackendSpecificModelContextPtr
virtual void RegisterTensorHandleFactories(class TensorHandleFactoryRegistry &)
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFa...
virtual std::unique_ptr< ICustomAllocator > GetDefaultAllocator() const
Returns the default memory allocator for the backend.
virtual OptimizationViews OptimizeSubgraphView(const SubgraphView &subgraph) const
IBackendInternal()=default
Creation must be done through a specific backend interface.
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
virtual IBackendProfilingContextPtr CreateBackendProfilingContext(const IRuntime::CreationOptions &creationOptions, IBackendProfilingPtr &backendProfiling)
Create context specifically used for profiling interaction from backends.
ITensorHandleFactory::FactoryId GetBackwardCompatibleFavoriteHandleFactory()
std::unique_ptr< IWorkloadFactory > IWorkloadFactoryPtr
static constexpr BackendVersion GetApiVersion()
Returns the version of the Backend API.
virtual unsigned int GetNumberOfCacheFiles() const
Returns the number of files cached if backend supports caching.
virtual bool UseCustomMemoryAllocator(std::shared_ptr< ICustomAllocator > allocator, armnn::Optional< std::string & > errMsg)
Signals the backend to use a custom memory allocator provided by the user.
~IBackendInternal() override=default
Allow backends created by the factory function to be destroyed through IBackendInternal.
virtual std::vector< ITensorHandleFactory::FactoryId > GetHandleFactoryPreferences() const
(Optional) Returns a vector of supported TensorHandleFactory ids in preference order.
virtual ILayerSupportSharedPtr GetLayerSupport() const =0
std::unique_ptr< IBackendContext > IBackendContextPtr
std::shared_ptr< arm::pipe::IBackendProfilingContext > IBackendProfilingContextPtr
This is the bridge between backend and backend profiling we'll keep it in the backend namespace.
bool SupportsTensorAllocatorAPI() const
virtual IWorkloadFactoryPtr CreateWorkloadFactory(const IMemoryManagerSharedPtr &memoryManager=nullptr) const =0
The SubgraphView class represents a subgraph of a Graph.
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
std::ostream & operator<<(std::ostream &os, const std::vector< Compute > &compute)
Deprecated function that will be removed together with the Compute enum.
unsigned int MemorySourceFlags
std::vector< BackendOptions > ModelOptions
BackendOptions BackendCapabilities
std::unique_ptr< IBackendInternal > IBackendInternalUniquePtr
Struct for the users to pass backend specific options.
bool operator<=(const BackendVersion &other) const
constexpr BackendVersion(uint32_t major, uint32_t minor)
bool operator==(const BackendVersion &other) const
bool operator>=(const BackendVersion &other) const
constexpr BackendVersion()