IVGCVSW-6313 Support pre-importing outputs
* Add ClearImportedInputs/Outputs function to IRuntime
* Add UnImport function to ITensorHandle
* Remove mutex from IWorkingMemHandle
Change-Id: I34c9b6e1618755e10f3b4597afa1d9a9ea97e5fe
Signed-off-by: Finn Williams <finwil01@e127804.cambridge.arm.com>
diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp
index ca9a0ce..47bfef5 100644
--- a/include/armnn/IRuntime.hpp
+++ b/include/armnn/IRuntime.hpp
@@ -242,6 +242,21 @@
/// Only compatible with AsyncEnabled networks
std::vector<ImportedInputId> ImportInputs(NetworkId networkId, const InputTensors& inputTensors);
+ /// ImportOutputs separates the importing and mapping of OutputTensors from network execution.
+ /// Allowing for a set of OutputTensors 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<ImportedInputId> ImportOutputs(NetworkId networkId, const OutputTensors& outputTensors);
+
+ /// Un-import and delete the imported InputTensor/s
+ /// This function is not thread safe and must not be used while other threads are calling Execute().
+ /// Only compatible with AsyncEnabled networks
+ void ClearImportedInputs(NetworkId networkId, const std::vector<ImportedInputId> inputIds);
+
+ /// Un-import and delete the imported OutputTensor/s
+ /// This function is not thread safe and must not be used while other threads are calling Execute().
+ /// Only compatible with AsyncEnabled networks
+ void ClearImportedOutputs(NetworkId networkId, const std::vector<ImportedOutputId> outputIds);
/// Evaluates a network using input in inputTensors and outputs filled into outputTensors
Status EnqueueWorkload(NetworkId networkId,
@@ -255,7 +270,8 @@
Status Execute(IWorkingMemHandle& workingMemHandle,
const InputTensors& inputTensors,
const OutputTensors& outputTensors,
- std::vector<ImportedInputId> preImportedInputs = {});
+ std::vector<ImportedInputId> preImportedInputs = {},
+ std::vector<ImportedOutputId> preImportedOutputs = {});
/// Unloads a network from the IRuntime.
/// At the moment this only removes the network from the m_Impl->m_Network.