15 #include <unordered_map> 20 namespace experimental
28 std::vector<WorkingMemDescriptor> workingMemDescriptors,
29 std::unordered_map<LayerGuid, WorkingMemDescriptor> workingMemDescriptorMap,
30 std::vector<std::shared_ptr<IMemoryManager>> memoryManagers,
31 std::unordered_map<
LayerGuid, std::vector<std::unique_ptr<ITensorHandle> > > ownedTensorHandles);
68 auto result = m_WorkingMemDescriptorMap.find(
id);
70 return result->second;
77 return m_WorkingMemDescriptors[id];
82 std::shared_ptr<ProfilerImpl> m_Profiler;
84 std::vector<WorkingMemDescriptor> m_WorkingMemDescriptors;
85 std::unordered_map<LayerGuid, WorkingMemDescriptor> m_WorkingMemDescriptorMap;
88 std::vector<std::shared_ptr<IMemoryManager>> m_MemoryManagers;
91 std::unordered_map<LayerGuid, std::vector<std::unique_ptr<ITensorHandle> > > m_OwnedTensorHandles;
WorkingMemDescriptor & GetWorkingMemDescriptorAt(unsigned int id) override
Get the WorkingMemDescriptor at an index.
Copyright (c) 2021 ARM Limited and Contributors.
NetworkId GetNetworkId() override
Returns the NetworkId of the Network that this IWorkingMemHandle works with.
WorkingMemDescriptor & GetWorkingMemDescriptor(LayerGuid id) override
Get the WorkingMemDescriptor for a Layer. The mutex must be locked.
#define ARMNN_ASSERT(COND)
void Allocate() override
Allocate the backing memory required for execution.
profiling::ProfilingGuid GetInferenceId() override
Returns the InferenceId of the Inference that this IWorkingMemHandle works with.
std::mutex & GetMutex() override
Get a mutex which can be used for synchronizing access to the WorkingMemHandle object.
bool IsAllocated() override
IsAllocated returns true if the backing memory is currently allocated. The mutex must be locked...
WorkingMemHandle(NetworkId networkId, std::vector< WorkingMemDescriptor > workingMemDescriptors, std::unordered_map< LayerGuid, WorkingMemDescriptor > workingMemDescriptorMap, std::vector< std::shared_ptr< IMemoryManager >> memoryManagers, std::unordered_map< LayerGuid, std::vector< std::unique_ptr< ITensorHandle > > > ownedTensorHandles)
void Free() override
Free the backing memory required for execution. The mutex must be locked.