29 : m_MemoryManager(memoryManager)
48 auto memCopyQueueDescriptor = PolymorphicDowncast<const MemCopyQueueDescriptor*>(&descriptor);
53 return std::make_unique<CopyMemGenericWorkload>(*memCopyQueueDescriptor,
info);
90 const std::string layerName(layer->
GetName());
91 bool optimizable = layerName.find(
"unoptimizable") == std::string::npos;
123 std::cerr <<
"could not deregister mock backend" << std::endl;
142 std::shared_ptr<armnn::MockBackendProfilingContext> context =
143 std::make_shared<MockBackendProfilingContext>(backendProfiling);
171 std::for_each(subgraphLayers.begin(),
172 subgraphLayers.end(),
183 supportedLayers.push_back(layer);
188 untouchedLayers.push_back(layer);
194 unsupportedLayers.push_back(layer);
199 if (!supportedLayers.empty())
202 auto supportedSubgraphSelector = [](
const Layer& layer)
216 std::for_each(supportedSubgraphs.begin(),
217 supportedSubgraphs.end(),
226 optimizationViews.
GetINetwork()->AddPrecompiledLayer(
228 supportedSubgraph->GetNumOutputSlots()),
236 optimizationViews.
AddSubstitution({ substitutionSubgraph, replacementSubgraph });
241 if (!unsupportedLayers.empty())
244 auto unsupportedSubgraphSelector = [](
const Layer& layer)
257 std::for_each(unsupportedSubgraphs.begin(),
258 unsupportedSubgraphs.end(),
268 if (!untouchedLayers.empty())
271 auto untouchedSubgraphSelector = [](
const Layer& layer)
285 std::for_each(untouchedSubgraphs.begin(),
286 untouchedSubgraphs.end(),
295 return optimizationViews;
300 return std::make_unique<DefaultAllocator>();
ARMNN_DEPRECATED_MSG_REMOVAL_DATE("Use ABI stable " "CreateWorkload(LayerType, const QueueDescriptor&, const WorkloadInfo& info) instead.", "23.08") std std::unique_ptr< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const override
std::unique_ptr< IWorkloadFactory > IWorkloadFactoryPtr
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
void SetProfilingContextPtr(std::shared_ptr< MockBackendProfilingContext > shared)
void Register(const BackendId &id, FactoryFunction factory)
const IConnectableLayers & GetIConnectableLayers() const
~MockBackendInitialiser()
IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory(const IBackendInternal::IMemoryManagerSharedPtr &memoryManager=nullptr) const override
IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override
void AddSubstitution(SubstitutionPair &&substitution)
constexpr const char * MockBackendId()
IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions &) const override
Create the runtime context of the backend.
BackendRegistry & BackendRegistryInstance()
OptimizationViews OptimizeSubgraphView(const SubgraphView &subgraph) const override
Copyright (c) 2021 ARM Limited and Contributors.
std::unique_ptr< IMemoryManager > IMemoryManagerUniquePtr
void IgnoreUnused(Ts &&...)
std::unique_ptr< void, CompiledBlobDeleter > CompiledBlobPtr
The SubgraphView class represents a subgraph of a Graph.
std::unique_ptr< SubgraphView > SubgraphViewPtr
std::list< IConnectableLayer * > IConnectableLayers
const BackendId & GetBackendId() const override
std::unique_ptr< ICustomAllocator > GetDefaultAllocator() const override
Returns the default memory allocator for the backend.
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
static const BackendId & GetIdStatic()
void AddFailedSubgraph(SubgraphView &&subgraph)
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
std::vector< SubgraphViewPtr > Subgraphs
INetworkPtr & GetINetwork()
#define ARMNN_ASSERT(COND)
static bool IsLayerSupported(const BackendId &backendId, const IConnectableLayer &layer, Optional< DataType > dataType, std::string &outReasonIfUnsupported)
bool IsLayerOptimizable(const armnn::Layer *layer)
static MockBackendProfilingService & Instance()
void AddUntouchedSubgraph(SubgraphView &&subgraph)
std::shared_ptr< arm::pipe::IBackendProfilingContext > IBackendProfilingContextPtr
This is the bridge between backend and backend profiling we'll keep it in the backend namespace...
IBackendInternal::IBackendProfilingContextPtr CreateBackendProfilingContext(const IRuntime::CreationOptions &creationOptions, IBackendProfilingPtr &backendProfiling) override
Create context specifically used for profiling interaction from backends.
std::shared_ptr< ILayerSupport > ILayerSupportSharedPtr
std::unique_ptr< arm::pipe::IBackendProfiling > IBackendProfilingPtr
static Subgraphs SelectSubgraphs(Graph &graph, const LayerSelectorFunction &selector)
Selects subgraphs from a graph based on the selector function and the algorithm.
void Deregister(const BackendId &id)
Contains information about TensorInfos of a layer.
const char * GetName() const override
Returns the name of the layer.
std::vector< ITensorHandle * > m_Inputs
std::unique_ptr< IBackendInternal > IBackendInternalUniquePtr
A PreCompiledDescriptor for the PreCompiledLayer.
IBackendInternal::IMemoryManagerUniquePtr CreateMemoryManager() const override
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below...
std::unique_ptr< IBackendContext > IBackendContextPtr