15 #include <unordered_map> 21 namespace experimental
29 std::vector<WorkingMemDescriptor> workingMemDescriptors,
30 std::unordered_map<LayerGuid, WorkingMemDescriptor> workingMemDescriptorMap,
31 std::vector<std::shared_ptr<IMemoryManager>> memoryManagers,
32 std::unordered_map<
LayerGuid, std::vector<std::unique_ptr<ITensorHandle> > > ownedTensorHandles);
66 auto result = m_WorkingMemDescriptorMap.find(
id);
68 return result->second;
75 return m_WorkingMemDescriptors[id];
80 std::shared_ptr<ProfilerImpl> m_Profiler;
82 std::vector<WorkingMemDescriptor> m_WorkingMemDescriptors;
83 std::unordered_map<LayerGuid, WorkingMemDescriptor> m_WorkingMemDescriptorMap;
86 std::vector<std::shared_ptr<IMemoryManager>> m_MemoryManagers;
89 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.
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...
profiling::ProfilingGuid LayerGuid
Define LayerGuid type.
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.