21.05
|
#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... | |
profiling::ProfilingGuid | GetInferenceId () override |
Returns the InferenceId of the Inference 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 23 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 33 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 34 of file WorkingMemHandle.cpp.
Referenced by LoadedNetwork::Execute(), and WorkingMemHandle::GetInferenceId().
|
overridevirtual |
Free the backing memory required for execution. The mutex must be locked.
Implements IWorkingMemHandle.
Definition at line 48 of file WorkingMemHandle.cpp.
Referenced by WorkingMemHandle::GetInferenceId(), and WorkingMemHandle::~WorkingMemHandle().
|
inlineoverridevirtual |
Returns the InferenceId of the Inference that this IWorkingMemHandle works with.
Implements IWorkingMemHandle.
Definition at line 41 of file WorkingMemHandle.hpp.
References WorkingMemHandle::Allocate(), and WorkingMemHandle::Free().
|
inlineoverridevirtual |
Get a mutex which can be used for synchronizing access to the WorkingMemHandle object.
Implements IWorkingMemHandle.
Definition at line 60 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 36 of file WorkingMemHandle.hpp.
|
inlineoverridevirtual |
Get the WorkingMemDescriptor for a Layer. The mutex must be locked.
Implements IWorkingMemHandle.
Definition at line 66 of file WorkingMemHandle.hpp.
References ARMNN_ASSERT.
Referenced by LoadedNetwork::Schedule().
|
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 75 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 54 of file WorkingMemHandle.hpp.
Referenced by LoadedNetwork::Execute().