17 #include <unordered_map>
24 namespace experimental
27 using BackendPtrMap = std::unordered_map<BackendId, IBackendInternalUniquePtr>;
51 std::vector<InputMemDescriptorCoords> inputLayerInfo,
52 std::vector<OutputMemDescriptorCoords> outputLayerInfo,
53 std::vector<WorkingMemDescriptor> workingMemDescriptors,
54 std::unique_ptr<MemoryManager> memoryManager,
55 std::vector<std::pair<std::shared_ptr<TensorMemory>,
MemorySource>> tensorMemory,
56 std::vector<std::unique_ptr<ITensorHandle>> managedTensorHandles,
57 std::vector<std::unique_ptr<ITensorHandle>> unmanagedTensorHandles,
58 std::vector<std::pair<BackendId, ExecutionData>> executionDataVec,
86 return m_WorkingMemDescriptors[id];
94 return m_ExecutionDataVec[id];
99 return m_InputHandleMap.at(layerBindingId);
104 return m_OutputHandleMap.at(layerBindingId);
109 return m_InputConnectionMap.at(layerBindingId);
114 return m_OutputConnectionMap.at(layerBindingId);
121 return m_BindingIdVec;
127 using DifferenceType = std::vector<ITensorHandle*>::difference_type;
130 std::unordered_map<LayerBindingId, ITensorHandle*> m_InputHandleMap;
131 std::unordered_map<LayerBindingId, ITensorHandle*> m_OutputHandleMap;
132 std::unordered_map<LayerBindingId, std::vector<std::vector<ITensorHandle*>::iterator>> m_InputConnectionMap;
133 std::unordered_map<LayerBindingId, std::vector<std::vector<ITensorHandle*>::iterator>> m_OutputConnectionMap;
135 std::vector<WorkingMemDescriptor> m_WorkingMemDescriptors;
137 std::unique_ptr<MemoryManager> m_MemoryManager;
140 std::vector<std::pair<std::shared_ptr<TensorMemory>,
MemorySource>> m_TensorMemory;
143 std::vector<std::unique_ptr<ITensorHandle>> m_ManagedTensorHandles;
146 std::vector<std::unique_ptr<ITensorHandle>> m_UnmanagedTensorHandles;
148 std::unordered_map<LayerBindingId, bool> m_InputValidationMap;
149 std::unordered_map<LayerBindingId, bool> m_OutputValidationMap;
151 std::vector<LayerBindingId> m_BindingIdVec;
153 DifferenceType m_InputSize;
157 std::vector<std::pair<BackendId, ExecutionData>> m_ExecutionDataVec;