From f37b970ff96b98310309e78aeea8a2e9df27b15a Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Wed, 1 Sep 2021 18:06:04 +0100 Subject: IVGCVSW-6312 Support pre-importing inputs Signed-off-by: Finn Williams Change-Id: Ifc5e6f2e36767cb2a5cbf281d40ec9989b581abc --- include/armnn/IRuntime.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include/armnn/IRuntime.hpp') diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp index 345cdeb10a..908fe7692d 100644 --- a/include/armnn/IRuntime.hpp +++ b/include/armnn/IRuntime.hpp @@ -221,6 +221,14 @@ public: TensorInfo GetInputTensorInfo(NetworkId networkId, LayerBindingId layerId) const; TensorInfo GetOutputTensorInfo(NetworkId networkId, LayerBindingId layerId) const; + + /// ImportInputs separates the importing and mapping of InputTensors from network execution. + /// Allowing for a set of InputTensors to be imported and mapped once, but used in execution many times. + /// This function is not thread safe and must not be used while other threads are calling Execute(). + /// Only compatible with AsyncEnabled networks + std::vector ImportInputs(NetworkId networkId, const InputTensors& inputTensors); + + /// Evaluates a network using input in inputTensors and outputs filled into outputTensors Status EnqueueWorkload(NetworkId networkId, const InputTensors& inputTensors, @@ -232,7 +240,8 @@ public: /// Will block until this and any other thread using the same workingMem object completes. Status Execute(IWorkingMemHandle& workingMemHandle, const InputTensors& inputTensors, - const OutputTensors& outputTensors); + const OutputTensors& outputTensors, + std::vector preImportedInputs = {}); /// Unloads a network from the IRuntime. /// At the moment this only removes the network from the m_Impl->m_Network. -- cgit v1.2.1