From e2af6f4322a1e2b8b3c391fb721a6a80c281477f Mon Sep 17 00:00:00 2001 From: Narumol Prangnawarat Date: Fri, 28 Jan 2022 17:59:18 +0000 Subject: IVGCVSW-6552 Add support of aligned host memory * Add AllocatedData functions to OutputHandler * Enable import aligned memory in ImportInputs * Enable import aligned memory in ImportOutputs * Allow to import input and output if the memory is aligned * Implement Reconfigure function on ClConvolution2dWorkload * End-to-end test on Ref and Cl to ensure that input and output memory are imported when aligned Signed-off-by: Narumol Prangnawarat Change-Id: I9e5e4c26d1ac2f1d806803ade5f64c6479c51718 --- include/armnn/IRuntime.hpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp index d85a3e3724..042271fc2b 100644 --- a/include/armnn/IRuntime.hpp +++ b/include/armnn/IRuntime.hpp @@ -216,18 +216,19 @@ 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); + /// Only compatible with AsyncEnabled networks and aligned memory import + std::vector ImportInputs(NetworkId networkId, const InputTensors& inputTensors, + MemorySource forceImportMemorySource = MemorySource::Undefined); /// 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 ImportOutputs(NetworkId networkId, const OutputTensors& outputTensors); + /// Only compatible with AsyncEnabled networks and aligned memory import + std::vector ImportOutputs(NetworkId networkId, const OutputTensors& outputTensors, + MemorySource forceImportMemorySource = MemorySource::Undefined); /// 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(). @@ -242,7 +243,9 @@ public: /// Evaluates a network using input in inputTensors and outputs filled into outputTensors Status EnqueueWorkload(NetworkId networkId, const InputTensors& inputTensors, - const OutputTensors& outputTensors); + const OutputTensors& outputTensors, + std::vector preImportedInputIds = {}, + std::vector preImportedOutputIds = {}); /// This is an experimental function. /// Evaluates a network using input in inputTensors and outputs filled into outputTensors. -- cgit v1.2.1