43 return IsLayerSupported(&layer);
51 const std::string layerName(layer->
GetName());
52 bool optimizable = layerName.find(
"unoptimizable") == std::string::npos;
59 return IsLayerOptimizable(&layer);
84 std::cerr <<
"could not deregister mock backend" << std::endl;
109 std::shared_ptr<armnn::MockBackendProfilingContext> context =
110 std::make_shared<MockBackendProfilingContext>(backendProfiling);
143 std::for_each(subgraphLayers.begin(),
144 subgraphLayers.end(),
147 bool supported = IsLayerSupported(layer);
151 bool optimizable = IsLayerOptimizable(layer);
155 supportedLayers.push_back(layer);
160 untouchedLayers.push_back(layer);
166 unsupportedLayers.push_back(layer);
171 if (!supportedLayers.empty())
174 auto supportedSubgraphSelector = [](
const Layer& layer)
178 IsLayerSupported(layer) &&
179 IsLayerOptimizable(layer);
188 std::for_each(supportedSubgraphs.begin(),
189 supportedSubgraphs.end(),
197 supportedSubgraph->GetNumOutputSlots()),
204 optimizationViews.
AddSubstitution({ substitutionSubgraph, replacementSubgraph });
209 if (!unsupportedLayers.empty())
212 auto unsupportedSubgraphSelector = [](
const Layer& layer)
216 !IsLayerSupported(layer);
225 std::for_each(unsupportedSubgraphs.begin(),
226 unsupportedSubgraphs.end(),
236 if (!untouchedLayers.empty())
239 auto untouchedSubgraphSelector = [](
const Layer& layer)
243 IsLayerSupported(layer) &&
244 !IsLayerOptimizable(layer);
253 std::for_each(untouchedSubgraphs.begin(),
254 untouchedSubgraphs.end(),
263 return optimizationViews;
std::unique_ptr< IWorkloadFactory > IWorkloadFactoryPtr
void SetProfilingContextPtr(std::shared_ptr< MockBackendProfilingContext > shared)
std::vector< OptimizationPtr > Optimizations
void Register(const BackendId &id, FactoryFunction factory)
LayerT * AddLayer(Args &&... args)
Adds a new layer, of type LayerType, to the graph constructed with the arguments passed.
~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) 2020 ARM Limited.
std::unique_ptr< IMemoryManager > IMemoryManagerUniquePtr
void IgnoreUnused(Ts &&...)
void SetBackendId(const BackendId &id)
IBackendInternal::Optimizations GetOptimizations() const override
The SubgraphView class represents a subgraph of a Graph.
std::unique_ptr< armnn::profiling::IBackendProfiling > IBackendProfilingPtr
std::unique_ptr< SubgraphView > SubgraphViewPtr
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
static const BackendId & GetIdStatic()
void AddFailedSubgraph(SubgraphView &&subgraph)
std::vector< SubgraphViewPtr > Subgraphs
#define ARMNN_ASSERT(COND)
static MockBackendProfilingService & Instance()
void AddUntouchedSubgraph(SubgraphView &&subgraph)
IBackendInternal::IBackendProfilingContextPtr CreateBackendProfilingContext(const IRuntime::CreationOptions &creationOptions, IBackendProfilingPtr &backendProfiling) override
Create context specifically used for profiling interaction from backends.
std::shared_ptr< ILayerSupport > ILayerSupportSharedPtr
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)
const Layers & GetLayers() const
LayerType GetType() const
const char * GetName() const override
Returns the name of the layer.
std::unique_ptr< IBackendInternal > IBackendInternalUniquePtr
A PreCompiledDescriptor for the PreCompiledLayer.
std::list< Layer * > Layers
std::unique_ptr< ISubGraphConverter > supported
std::shared_ptr< armnn::profiling::IBackendProfilingContext > IBackendProfilingContextPtr
This is the bridge between backend and backend profiling we'll keep it in the backend namespace...
IBackendInternal::IMemoryManagerUniquePtr CreateMemoryManager() const override
std::unique_ptr< IBackendContext > IBackendContextPtr