ArmNN
 20.08
NeonTensorHandleFactory.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
10 
11 namespace armnn
12 {
13 
14 constexpr const char* NeonTensorHandleFactoryId() { return "Arm/Neon/TensorHandleFactory"; }
15 
16 const std::set<armnn::LayerType> paddingRequiredLayers {
33 };
34 
36 {
37 public:
38  NeonTensorHandleFactory(std::weak_ptr<NeonMemoryManager> mgr)
39  : m_MemoryManager(mgr),
40  m_ImportFlags(static_cast<MemorySourceFlags>(MemorySource::Malloc)),
41  m_ExportFlags(static_cast<MemorySourceFlags>(MemorySource::Malloc))
42  {}
43 
44  std::unique_ptr<ITensorHandle> CreateSubTensorHandle(ITensorHandle& parent,
45  const TensorShape& subTensorShape,
46  const unsigned int* subTensorOrigin) const override;
47 
48  std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo) const override;
49 
50  std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo,
51  DataLayout dataLayout) const override;
52 
53  std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo,
54  const bool IsMemoryManaged) const override;
55 
56  std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo,
57  DataLayout dataLayout,
58  const bool IsMemoryManaged = true) const override;
59 
60  static const FactoryId& GetIdStatic();
61 
62  const FactoryId& GetId() const override;
63 
64  bool SupportsSubTensors() const override;
65 
66  MemorySourceFlags GetExportFlags() const override;
67 
68  MemorySourceFlags GetImportFlags() const override;
69 
70  std::vector<Capability> GetCapabilities(const IConnectableLayer* layer,
71  const IConnectableLayer* connectedLayer,
72  CapabilityClass capabilityClass) override;
73 
74 private:
75  mutable std::shared_ptr<NeonMemoryManager> m_MemoryManager;
76  MemorySourceFlags m_ImportFlags;
77  MemorySourceFlags m_ExportFlags;
78 };
79 
80 } // namespace armnn
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:61
DataLayout
Definition: Types.hpp:49
MemorySourceFlags GetImportFlags() const override
CapabilityClass
Capability class to calculate in the GetCapabilities function so that only the capability in the scop...
std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const override
unsigned int MemorySourceFlags
Copyright (c) 2020 ARM Limited.
const std::set< armnn::LayerType > paddingRequiredLayers
const FactoryId & GetId() const override
MemorySourceFlags GetExportFlags() const override
constexpr const char * NeonTensorHandleFactoryId()
std::vector< Capability > GetCapabilities(const IConnectableLayer *layer, const IConnectableLayer *connectedLayer, CapabilityClass capabilityClass) override
NeonTensorHandleFactory(std::weak_ptr< NeonMemoryManager > mgr)
static const FactoryId & GetIdStatic()
std::unique_ptr< ITensorHandle > CreateSubTensorHandle(ITensorHandle &parent, const TensorShape &subTensorShape, const unsigned int *subTensorOrigin) const override