24.08
|
Go to the documentation of this file.
31 return std::make_unique<RefWorkloadFactory>(PolymorphicPointerDowncast<RefMemoryManager>(memoryManager));
37 auto memoryManager = std::make_shared<RefMemoryManager>();
41 std::unique_ptr<RefTensorHandleFactory> factory = std::make_unique<RefTensorHandleFactory>(memoryManager);
47 return std::make_unique<RefWorkloadFactory>(PolymorphicPointerDowncast<RefMemoryManager>(memoryManager));
63 return std::make_unique<RefMemoryManager>();
77 auto it = subgraph.
end();
78 std::map<LayerGuid, Layer*> untouched;
80 while (it != subgraph.
begin())
83 Layer& base = *(PolymorphicDowncast<Layer*>(*it));
84 untouched.insert({base.
GetGuid(), &base});
88 while (it != subgraph.
begin())
91 Layer& base = *(PolymorphicDowncast<Layer*>(*it));
97 Pooling2dLayer* baseLayer = PolymorphicDowncast<Pooling2dLayer*>(&base);
102 PadLayer* padLayer = PolymorphicDowncast<PadLayer*>(
110 FoldPadIntoAveragePool2d<Pooling2dLayer>(optimizationViews, baseLayer,
111 poolingDescriptor, padLayer);
112 untouched.erase(baseLayer->
GetGuid());
113 untouched.erase(padLayer->
GetGuid());
121 ReshapeLayer* baseLayer = PolymorphicDowncast<ReshapeLayer*>(&base);
135 return optimizationViews;
145 auto memoryManager = std::make_shared<RefMemoryManager>();
149 std::unique_ptr<RefTensorHandleFactory> factory = std::make_unique<RefTensorHandleFactory>(memoryManager);
159 return std::make_unique<DefaultAllocator>();
165 executionData.
m_Data = &workingMemDescriptor;
166 return executionData;
171 executionData.
m_Data = &workingMemDescriptor;
void AddUntouchedSubgraph(SubgraphView &&subgraph)
OptimizationViews OptimizeSubgraphView(const SubgraphView &subgraph, const ModelOptions &modelOptions) const override
IBackendInternal::IBackendProfilingContextPtr CreateBackendProfilingContext(const IRuntime::CreationOptions &creationOptions, IBackendProfilingPtr &backendProfiling) override
Create context specifically used for profiling interaction from backends.
const TensorInfo & GetTensorInfo() const override
IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions &) const override
Create the runtime context of the backend.
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
static const FactoryId & GetIdStatic()
constexpr const char * RefBackendId()
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
void RegisterMemoryManager(std::shared_ptr< IMemoryManager > memoryManger)
Register a memory manager with shared ownership.
std::unique_ptr< IBackendContext > IBackendContextPtr
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
const Parameters & GetParameters() const override
If the layer has a descriptor return it.
IBackendInternal::IMemoryManagerUniquePtr CreateMemoryManager() const override
static const BackendId & GetIdStatic()
std::unique_ptr< ICustomAllocator > GetDefaultAllocator() const override
Returns the default memory allocator for the backend.
Layer & GetOwningLayer() const
bool TryFoldPadIntoLayer2d(const PadDescriptor &padDescriptor, Descriptor &layerDescriptor, const TensorInfo &tensorInfo)
This layer represents a reshape operation.
IConnectableLayerIterator begin()
void RemoveReshapeLayer(ReshapeLayer *baseLayer, std::map< LayerGuid, Layer * > &untouched, OptimizationViews &optimizationViews)
unsigned int GetNumConnections() const override
IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override
LayerGuid GetGuid() const final
Returns the unique id of the layer.
The SubgraphView class represents a subgraph of a Graph.
This layer represents a pooling 2d operation.
IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory(const IBackendInternal::IMemoryManagerSharedPtr &memoryManager=nullptr) const override
void RegisterTensorHandleFactories(class TensorHandleFactoryRegistry ®istry) override
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFa...
ExecutionData CreateExecutionData(WorkingMemDescriptor &workingMemDescriptor) const override
Returns ExecutionData for the backend.
std::shared_ptr< arm::pipe::IBackendProfilingContext > IBackendProfilingContextPtr
This is the bridge between backend and backend profiling we'll keep it in the backend namespace.
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
std::unique_ptr< arm::pipe::IBackendProfiling > IBackendProfilingPtr
void UpdateExecutionData(ExecutionData &executionData, WorkingMemDescriptor &workingMemDescriptor) const override
Update the ExecutionData for a layer.
std::unique_ptr< IMemoryManager > IMemoryManagerUniquePtr
const Substitutions & GetSubstitutions() const
IConnectableLayerIterator end()
const Subgraphs & GetDeletedSubgraphs() const
Copyright (c) 2021 ARM Limited and Contributors.
void RegisterFactory(std::unique_ptr< ITensorHandleFactory > allocator)
Register a TensorHandleFactory and transfer ownership.
std::shared_ptr< ILayerSupport > ILayerSupportSharedPtr
void RegisterCopyAndImportFactoryPair(ITensorHandleFactory::FactoryId copyFactoryId, ITensorHandleFactory::FactoryId importFactoryId)
Register a pair of TensorHandleFactory Id for Memory Copy and TensorHandleFactory Id for Memory Impor...
std::vector< BackendOptions > ModelOptions
std::vector< ITensorHandleFactory::FactoryId > GetHandleFactoryPreferences() const override
(Optional) Returns a vector of supported TensorHandleFactory ids in preference order.
void ReportUntouchedLayers(OptimizationViews &optimizationViews, std::map< LayerGuid, Layer * > untouched)
A Pooling2dDescriptor for the Pooling2dLayer.
std::unique_ptr< IWorkloadFactory > IWorkloadFactoryPtr
This layer represents a pad operation.