aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFinn Williams <Finn.Williams@arm.com>2021-09-01 18:06:04 +0100
committerJim Flynn <jim.flynn@arm.com>2021-09-15 11:23:05 +0000
commitf37b970ff96b98310309e78aeea8a2e9df27b15a (patch)
tree73f1e3db6552649ac57901fd3df7fadc9742385e /include
parentfc8d434bb318aebb433a2f6d8ce9c066cd9c1b1e (diff)
downloadarmnn-f37b970ff96b98310309e78aeea8a2e9df27b15a.tar.gz
IVGCVSW-6312 Support pre-importing inputs
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: Ifc5e6f2e36767cb2a5cbf281d40ec9989b581abc
Diffstat (limited to 'include')
-rw-r--r--include/armnn/IRuntime.hpp11
-rw-r--r--include/armnn/Types.hpp1
2 files changed, 11 insertions, 1 deletions
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<ImportedInputId> 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<ImportedInputId> preImportedInputs = {});
/// Unloads a network from the IRuntime.
/// At the moment this only removes the network from the m_Impl->m_Network.
diff --git a/include/armnn/Types.hpp b/include/armnn/Types.hpp
index 0b7b941008..c3b439a2d9 100644
--- a/include/armnn/Types.hpp
+++ b/include/armnn/Types.hpp
@@ -265,6 +265,7 @@ public:
/// Type of identifiers for bindable layers (inputs, outputs).
using LayerBindingId = int;
+using ImportedInputId = unsigned int;
class PermutationVector
{