24.02
|
#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 |
std::vector< ImportedInputId > | ImportInputs (const InputTensors &inputTensors, MemorySource forceImportMemorySource=MemorySource::Undefined) |
std::vector< ImportedOutputId > | ImportOutputs (const OutputTensors &outputTensors, MemorySource forceImportMemorySource=MemorySource::Undefined) |
void | ClearImportedInputs (const std::vector< ImportedInputId > inputIds) |
void | ClearImportedOutputs (const std::vector< ImportedOutputId > outputIds) |
Status | EnqueueWorkload (const InputTensors &inputTensors, const OutputTensors &outputTensors, std::vector< ImportedInputId > preImportedInputIds={}, std::vector< ImportedOutputId > preImportedOutputIds={}) |
Single thread execution of the loaded network. More... | |
Status | Execute (const InputTensors &inputTensors, const OutputTensors &outputTensors, IWorkingMemHandle &workingMemHandle, std::vector< ImportedInputId > preImportedInputs={}, std::vector< ImportedOutputId > preImportedOutputs={}) |
Thread safe execution of the loaded network. More... | |
const std::shared_ptr< IProfiler > & | GetProfiler () const |
void | FreeWorkingMemory () |
void | RegisterDebugCallback (const DebugCallbackFunction &func) |
void | SendNetworkStructure (arm::pipe::IProfilingService &profilingService) |
bool | IsAsyncEnabled () |
arm::pipe::ProfilingGuid | GetNetworkGuid () |
Static Public Member Functions | |
static std::unique_ptr< LoadedNetwork > | MakeLoadedNetwork (std::unique_ptr< IOptimizedNetwork > net, std::string &errorMessage, const INetworkProperties &networkProperties, arm::pipe::IProfilingService *profilingService) |
Definition at line 42 of file LoadedNetwork.hpp.
using WorkloadQueue = std::vector<std::unique_ptr<IWorkload> > |
Definition at line 45 of file LoadedNetwork.hpp.
|
inline |
Definition at line 47 of file LoadedNetwork.hpp.
References LoadedNetwork::FreeWorkingMemory().
void ClearImportedInputs | ( | const std::vector< ImportedInputId > | inputIds | ) |
Definition at line 1699 of file LoadedNetwork.cpp.
Referenced by RuntimeImpl::ClearImportedInputs().
void ClearImportedOutputs | ( | const std::vector< ImportedOutputId > | outputIds | ) |
Definition at line 1720 of file LoadedNetwork.cpp.
Referenced by RuntimeImpl::ClearImportedOutputs().
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 1963 of file LoadedNetwork.cpp.
References ARMNN_ASSERT, ARMNN_NO_DEPRECATE_WARN_BEGIN, ARMNN_NO_DEPRECATE_WARN_END, ITensorHandleFactory::CreateTensorHandle(), Layer::GetBackendId(), TensorHandleFactoryRegistry::GetFactory(), and ITensorHandleFactory::LegacyFactoryId.
Referenced by RuntimeImpl::CreateWorkingMemHandle().
Status EnqueueWorkload | ( | const InputTensors & | inputTensors, |
const OutputTensors & | outputTensors, | ||
std::vector< ImportedInputId > | preImportedInputIds = {} , |
||
std::vector< ImportedOutputId > | preImportedOutputIds = {} |
||
) |
Single thread execution of the loaded network.
Definition at line 851 of file LoadedNetwork.cpp.
References ARMNN_ASSERT_MSG, ARMNN_LOG, ARMNN_SCOPED_PROFILING_EVENT, armnn::Failure, OutputHandler::GetData(), Graph::GetInputLayers(), Graph::GetNumInputs(), Graph::GetNumLayers(), Graph::GetNumOutputs(), Graph::GetOutputLayers(), armnn::info, QueueDescriptor::m_Inputs, armnn::Undefined, and armnn::warning.
Referenced by RuntimeImpl::EnqueueWorkload().
Status Execute | ( | const InputTensors & | inputTensors, |
const OutputTensors & | outputTensors, | ||
IWorkingMemHandle & | workingMemHandle, | ||
std::vector< ImportedInputId > | preImportedInputs = {} , |
||
std::vector< ImportedOutputId > | preImportedOutputs = {} |
||
) |
Thread safe execution of the loaded network.
Definition at line 1741 of file LoadedNetwork.cpp.
References WorkingMemHandle::Allocate(), ARMNN_LOG, ARMNN_SCOPED_PROFILING_EVENT, armnn::CopyToOutputTensor(), armnn::error, armnn::Failure, WorkingMemHandle::GetBindingIdVector(), WorkingMemHandle::GetExecutionDataAt(), WorkingMemHandle::GetInputConnections(), WorkingMemHandle::GetInputHandle(), Graph::GetNumInputs(), Graph::GetNumOutputs(), WorkingMemHandle::GetOutputConnection(), WorkingMemHandle::GetOutputHandle(), WorkingMemHandle::IsAllocated(), INetworkProperties::m_OutputSource, WorkingMemHandle::MemSyncOutputs(), armnn::Success, armnn::Undefined, and WorkingMemHandle::ValidateBindingIds().
Referenced by RuntimeImpl::Execute().
void FreeWorkingMemory | ( | ) |
Definition at line 1234 of file LoadedNetwork.cpp.
References TensorHandleFactoryRegistry::ReleaseMemory().
Referenced by RuntimeImpl::CreateWorkingMemHandle(), RuntimeImpl::EnqueueWorkload(), and LoadedNetwork::~LoadedNetwork().
TensorInfo GetInputTensorInfo | ( | LayerBindingId | layerId | ) | const |
Definition at line 709 of file LoadedNetwork.cpp.
References ARMNN_ASSERT_MSG.
Referenced by RuntimeImpl::GetInputTensorInfo().
ProfilingGuid GetNetworkGuid | ( | ) |
Definition at line 704 of file LoadedNetwork.cpp.
TensorInfo GetOutputTensorInfo | ( | LayerBindingId | layerId | ) | const |
Definition at line 723 of file LoadedNetwork.cpp.
References ARMNN_ASSERT_MSG.
Referenced by RuntimeImpl::GetOutputTensorInfo().
|
inline |
Definition at line 87 of file LoadedNetwork.hpp.
Referenced by RuntimeImpl::CreateWorkingMemHandle(), RuntimeImpl::EnqueueWorkload(), and RuntimeImpl::Execute().
std::vector< ImportedInputId > ImportInputs | ( | const InputTensors & | inputTensors, |
MemorySource | forceImportMemorySource = MemorySource::Undefined |
||
) |
Definition at line 1430 of file LoadedNetwork.cpp.
References ARMNN_ASSERT, ARMNN_LOG, Graph::InputLayersAccessor::begin(), armnn::CheckFlag(), ITensorHandleFactory::CreateTensorHandle(), Graph::InputLayersAccessor::end(), armnn::error, Layer::GetBackendId(), TensorHandleFactoryRegistry::GetFactory(), ITensorHandle::GetImportFlags(), Graph::GetInputLayers(), Layer::GetOutputSlots(), OutputSlot::GetTensorHandleFactoryId(), OutputSlot::GetTensorInfo(), Layer::GetType(), armnn::HasMatchingCapability(), ITensorHandle::Import(), armnn::Input, INetworkProperties::m_AsyncEnabled, INetworkProperties::m_InputSource, armnn::Undefined, and Exception::what().
Referenced by RuntimeImpl::ImportInputs().
std::vector< ImportedOutputId > ImportOutputs | ( | const OutputTensors & | outputTensors, |
MemorySource | forceImportMemorySource = MemorySource::Undefined |
||
) |
Definition at line 1573 of file LoadedNetwork.cpp.
References ARMNN_ASSERT, ARMNN_LOG, Graph::OutputLayersAccessor::begin(), armnn::CheckFlag(), ITensorHandleFactory::CreateTensorHandle(), Graph::OutputLayersAccessor::end(), armnn::error, Layer::GetBackendId(), InputSlot::GetConnectedOutputSlot(), TensorHandleFactoryRegistry::GetFactory(), ITensorHandle::GetImportFlags(), Layer::GetInputSlots(), Graph::GetOutputLayers(), OutputSlot::GetTensorHandleFactoryId(), InputSlot::GetTensorInfo(), Layer::GetType(), armnn::HasMatchingCapability(), ITensorHandle::Import(), INetworkProperties::m_AsyncEnabled, armnn::Output, armnn::Undefined, and Exception::what().
Referenced by RuntimeImpl::ImportOutputs().
|
inline |
Definition at line 95 of file LoadedNetwork.hpp.
References INetworkProperties::m_AsyncEnabled.
Referenced by RuntimeImpl::CreateWorkingMemHandle(), RuntimeImpl::EnqueueWorkload(), and RuntimeImpl::Execute().
|
static |
Definition at line 170 of file LoadedNetwork.cpp.
References ARMNN_LOG, and armnn::error.
Referenced by RuntimeImpl::LoadNetwork().
void RegisterDebugCallback | ( | const DebugCallbackFunction & | func | ) |
Definition at line 2227 of file LoadedNetwork.cpp.
Referenced by RuntimeImpl::RegisterDebugCallback().
void SendNetworkStructure | ( | arm::pipe::IProfilingService & | profilingService | ) |
Definition at line 666 of file LoadedNetwork.cpp.
References ARMNN_SCOPED_PROFILING_EVENT, armnn::Input, armnn::Output, and armnn::Undefined.