21.08
|
#include <WorkingMemHandle.hpp>
Public Member Functions | |
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) | |
~WorkingMemHandle () | |
NetworkId | GetNetworkId () override |
Returns the NetworkId of the Network that this IWorkingMemHandle works with. More... | |
void | Allocate () override |
Allocate the backing memory required for execution. More... | |
void | Free () override |
Free the backing memory required for execution. The mutex must be locked. More... | |
bool | IsAllocated () override |
IsAllocated returns true if the backing memory is currently allocated. The mutex must be locked. More... | |
std::mutex & | GetMutex () override |
Get a mutex which can be used for synchronizing access to the WorkingMemHandle object. More... | |
WorkingMemDescriptor & | GetWorkingMemDescriptor (LayerGuid id) override |
Get the WorkingMemDescriptor for a Layer. The mutex must be locked. More... | |
WorkingMemDescriptor & | GetWorkingMemDescriptorAt (unsigned int id) override |
Get the WorkingMemDescriptor at an index. More... | |
Public Member Functions inherited from IWorkingMemHandle | |
virtual | ~IWorkingMemHandle () |
Definition at line 24 of file WorkingMemHandle.hpp.
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 | ||
) |
Definition at line 17 of file WorkingMemHandle.cpp.
|
inline |
Definition at line 34 of file WorkingMemHandle.hpp.
References WorkingMemHandle::Free().
|
overridevirtual |
Allocate the backing memory required for execution.
If this is not called, then allocation will be deferred to execution time. The mutex must be locked.
Implements IWorkingMemHandle.
Definition at line 33 of file WorkingMemHandle.cpp.
Referenced by LoadedNetwork::Execute(), and WorkingMemHandle::GetNetworkId().
|
overridevirtual |
Free the backing memory required for execution. The mutex must be locked.
Implements IWorkingMemHandle.
Definition at line 47 of file WorkingMemHandle.cpp.
Referenced by WorkingMemHandle::GetNetworkId(), and WorkingMemHandle::~WorkingMemHandle().
|
inlineoverridevirtual |
Get a mutex which can be used for synchronizing access to the WorkingMemHandle object.
Implements IWorkingMemHandle.
Definition at line 58 of file WorkingMemHandle.hpp.
Referenced by LoadedNetwork::Execute().
|
inlineoverridevirtual |
Returns the NetworkId of the Network that this IWorkingMemHandle works with.
Implements IWorkingMemHandle.
Definition at line 37 of file WorkingMemHandle.hpp.
References WorkingMemHandle::Allocate(), and WorkingMemHandle::Free().
|
inlineoverridevirtual |
Get the WorkingMemDescriptor for a Layer. The mutex must be locked.
Implements IWorkingMemHandle.
Definition at line 64 of file WorkingMemHandle.hpp.
References ARMNN_ASSERT.
Referenced by LoadedNetwork::FreeWorkingMemory().
|
inlineoverridevirtual |
Get the WorkingMemDescriptor at an index.
The WorkingMemDescriptors are stored in the same order as the Workloads in a topologically sorted graph. The mutex must be locked.
Implements IWorkingMemHandle.
Definition at line 73 of file WorkingMemHandle.hpp.
Referenced by LoadedNetwork::Execute().
|
inlineoverridevirtual |
IsAllocated returns true if the backing memory is currently allocated. The mutex must be locked.
Implements IWorkingMemHandle.
Definition at line 52 of file WorkingMemHandle.hpp.
Referenced by LoadedNetwork::Execute().