21.08
|
#include <LoadedNetwork.hpp>
Public Types | |
using | WorkloadQueue = std::vector< std::unique_ptr< IWorkload > > |
Public Member Functions | |
~LoadedNetwork () | |
std::unique_ptr< IWorkingMemHandle > | CreateWorkingMemHandle (NetworkId networkId) |
Create a new unique WorkingMemHandle object. More... | |
TensorInfo | GetInputTensorInfo (LayerBindingId layerId) const |
TensorInfo | GetOutputTensorInfo (LayerBindingId layerId) const |
Status | EnqueueWorkload (const InputTensors &inputTensors, const OutputTensors &outputTensors) |
Single thread execution of the loaded network. More... | |
Status | Execute (const InputTensors &inputTensors, const OutputTensors &outputTensors, IWorkingMemHandle &workingMemHandle) |
Thread safe execution of the loaded network. More... | |
const std::shared_ptr< IProfiler > & | GetProfiler () const |
void | FreeWorkingMemory () |
void | RegisterDebugCallback (const DebugCallbackFunction &func) |
void | SendNetworkStructure () |
bool | IsAsyncEnabled () |
profiling::ProfilingGuid | GetNetworkGuid () |
Static Public Member Functions | |
static std::unique_ptr< LoadedNetwork > | MakeLoadedNetwork (std::unique_ptr< IOptimizedNetwork > net, std::string &errorMessage, const INetworkProperties &networkProperties, profiling::ProfilingService &profilingService) |
Definition at line 35 of file LoadedNetwork.hpp.
using WorkloadQueue = std::vector<std::unique_ptr<IWorkload> > |
Definition at line 38 of file LoadedNetwork.hpp.
|
inline |
Definition at line 40 of file LoadedNetwork.hpp.
std::unique_ptr< IWorkingMemHandle > CreateWorkingMemHandle | ( | NetworkId | networkId | ) |
Create a new unique WorkingMemHandle object.
Create multiple handles if you wish to have overlapped Execution by calling this function from different threads.
Definition at line 1107 of file LoadedNetwork.cpp.
References ITensorHandle::Allocate(), ARMNN_ASSERT, ARMNN_NO_DEPRECATE_WARN_BEGIN, ARMNN_NO_DEPRECATE_WARN_END, armnn::Constant, ITensorHandleFactory::CreateTensorHandle(), Layer::GetBackendId(), TensorHandleFactoryRegistry::GetFactory(), Layer::GetGuid(), Layer::GetInputSlots(), TensorHandleFactoryRegistry::GetMemoryManagers(), Layer::GetNumOutputSlots(), Layer::GetOutputSlots(), Layer::GetType(), armnn::Input, ITensorHandleFactory::LegacyFactoryId, WorkingMemDescriptor::m_Inputs, WorkingMemDescriptor::m_Outputs, ITensorHandle::Manage(), armnn::MemImport, and armnn::Output.
Referenced by RuntimeImpl::CreateWorkingMemHandle().
Status EnqueueWorkload | ( | const InputTensors & | inputTensors, |
const OutputTensors & | outputTensors | ||
) |
Single thread execution of the loaded network.
Definition at line 525 of file LoadedNetwork.cpp.
References ARMNN_ASSERT_MSG, ARMNN_LOG, ARMNN_SCOPED_HEAP_PROFILING, ARMNN_SCOPED_PROFILING_EVENT, armnn::CheckFlag(), armnn::Failure, ITensorHandle::GetImportFlags(), Graph::GetInputLayers(), Layer::GetInputSlots(), Graph::GetNumInputs(), Layer::GetNumInputSlots(), Graph::GetNumLayers(), Graph::GetNumOutputs(), Layer::GetNumOutputSlots(), Layer::GetOutputHandler(), Graph::GetOutputLayers(), TimelineUtilityMethods::GetTimelineUtils(), Layer::GetType(), armnn::IgnoreUnused(), ITensorHandle::Import(), armnn::info, armnn::Input, QueueDescriptor::m_Inputs, WorkloadInfo::m_InputTensorInfos, QueueDescriptor::m_Outputs, WorkloadInfo::m_OutputTensorInfos, ITensorHandle::Map(), armnn::Output, armnn::Success, armnn::Undefined, ITensorHandle::Unmap(), and armnn::warning.
Referenced by RuntimeImpl::EnqueueWorkload().
Status Execute | ( | const InputTensors & | inputTensors, |
const OutputTensors & | outputTensors, | ||
IWorkingMemHandle & | workingMemHandle | ||
) |
Thread safe execution of the loaded network.
Definition at line 1003 of file LoadedNetwork.cpp.
References WorkingMemHandle::Allocate(), ARMNN_LOG, ARMNN_SCOPED_PROFILING_EVENT, armnn::error, armnn::Failure, Graph::GetInputLayers(), armnn::GetInputTensor(), WorkingMemHandle::GetMutex(), Graph::GetNumInputs(), Graph::GetNumLayers(), Graph::GetOutputLayers(), armnn::GetOutputTensor(), TimelineUtilityMethods::GetTimelineUtils(), WorkingMemHandle::GetWorkingMemDescriptorAt(), WorkingMemHandle::IsAllocated(), armnn::profiling::RetentionLink, armnn::Success, armnn::Undefined, and armnn::warning.
Referenced by RuntimeImpl::Execute(), and LoadedNetwork::FreeWorkingMemory().
void FreeWorkingMemory | ( | ) |
Definition at line 781 of file LoadedNetwork.cpp.
References ARMNN_ASSERT_MSG, ARMNN_LOG, ARMNN_SCOPED_PROFILING_EVENT, armnn::CheckFlag(), armnn::CopyTensorContentsGeneric(), armnn::error, LoadedNetwork::Execute(), Layer::GetGuid(), ITensorHandle::GetImportFlags(), BaseTensor< MemoryType >::GetInfo(), Layer::GetInputSlots(), BaseTensor< MemoryType >::GetMemoryArea(), Layer::GetNumInputSlots(), Layer::GetType(), WorkingMemHandle::GetWorkingMemDescriptor(), ITensorHandle::Import(), armnn::Input, WorkingMemDescriptor::m_Inputs, WorkingMemDescriptor::m_Outputs, ITensorHandle::Map(), armnn::Output, armnn::Undefined, and ITensorHandle::Unmap().
Referenced by RuntimeImpl::CreateWorkingMemHandle(), and RuntimeImpl::EnqueueWorkload().
TensorInfo GetInputTensorInfo | ( | LayerBindingId | layerId | ) | const |
Definition at line 376 of file LoadedNetwork.cpp.
References ARMNN_ASSERT_MSG.
Referenced by RuntimeImpl::GetInputTensorInfo().
profiling::ProfilingGuid GetNetworkGuid | ( | ) |
Definition at line 371 of file LoadedNetwork.cpp.
TensorInfo GetOutputTensorInfo | ( | LayerBindingId | layerId | ) | const |
Definition at line 390 of file LoadedNetwork.cpp.
References ARMNN_ASSERT_MSG, CHECK_LOCATION, BackendId::Get(), Layer::GetBackendId(), Layer::GetNameStr(), armnn::IgnoreUnused(), armnn::info, and IWorkloadFactory::IsLayerSupported().
Referenced by RuntimeImpl::GetOutputTensorInfo().
|
inline |
Definition at line 68 of file LoadedNetwork.hpp.
Referenced by RuntimeImpl::CreateWorkingMemHandle(), RuntimeImpl::EnqueueWorkload(), and RuntimeImpl::Execute().
|
inline |
Definition at line 76 of file LoadedNetwork.hpp.
Referenced by RuntimeImpl::CreateWorkingMemHandle(), RuntimeImpl::EnqueueWorkload(), and RuntimeImpl::Execute().
|
static |
Definition at line 81 of file LoadedNetwork.cpp.
References ITensorHandle::Allocate(), ARMNN_ASSERT, ARMNN_LOG, armnn::BackendRegistryInstance(), armnn::Constant, IBackendInternal::CreateMemoryManager(), IBackendInternal::CreateWorkloadFactory(), armnn::error, armnnUtils::Processes::GetCurrentId(), BackendRegistry::GetFactory(), ProfilerManager::GetInstance(), TimelineUtilityMethods::GetTimelineUtils(), armnn::Input, ITensorHandleFactory::LegacyFactoryId, INetworkProperties::m_AsyncEnabled, INetworkProperties::m_OutputNetworkDetails, WorkingMemDescriptor::m_Outputs, INetworkProperties::m_ProfilingEnabled, armnn::MemImport, armnn::Output, ProfilerManager::RegisterProfiler(), IBackendInternal::SupportsTensorAllocatorAPI(), and Graph::TopologicalSort().
Referenced by RuntimeImpl::LoadNetwork().
void RegisterDebugCallback | ( | const DebugCallbackFunction & | func | ) |
Definition at line 1249 of file LoadedNetwork.cpp.
Referenced by RuntimeImpl::RegisterDebugCallback().
void SendNetworkStructure | ( | ) |
Definition at line 334 of file LoadedNetwork.cpp.
References TimelineUtilityMethods::GetTimelineUtils(), armnn::Input, armnn::Output, and Graph::TopologicalSort().