aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFinn Williams <finn.williams@arm.com>2022-03-30 12:09:47 +0100
committerFinn Williams <finn.williams@arm.com>2022-04-04 16:59:15 +0100
commit8dc56289c8f6acddbbd17a7a77b06d333369a7f8 (patch)
tree298882d9ae9d230fb7e19ff70058b4443604516e
parentde1cd79500a3e6b8744d00fbf54abaae741d881f (diff)
downloadarmnn-8dc56289c8f6acddbbd17a7a77b06d333369a7f8.tar.gz
IVGCVSW-6754 Integrate Import Host Memory to arm-armnn-sl
Signed-off-by: Finn Williams <finn.williams@arm.com> Change-Id: I1d465725e56f61034cb2425157bb594b4ceab9fa
-rw-r--r--include/armnn/IRuntime.hpp6
-rw-r--r--shim/sl/canonical/ArmnnPreparedModel.cpp10
2 files changed, 11 insertions, 5 deletions
diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp
index 042271fc2b..7cd7efda3d 100644
--- a/include/armnn/IRuntime.hpp
+++ b/include/armnn/IRuntime.hpp
@@ -219,25 +219,23 @@ public:
/// 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 and aligned memory import
+ /// Only compatible with aligned memory import
std::vector<ImportedInputId> 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 and aligned memory import
+ /// Only compatible with aligned memory import
std::vector<ImportedOutputId> 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().
- /// 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
diff --git a/shim/sl/canonical/ArmnnPreparedModel.cpp b/shim/sl/canonical/ArmnnPreparedModel.cpp
index 94809497d1..35edfb7d99 100644
--- a/shim/sl/canonical/ArmnnPreparedModel.cpp
+++ b/shim/sl/canonical/ArmnnPreparedModel.cpp
@@ -385,7 +385,15 @@ ErrorStatus ArmnnPreparedModel::ExecuteGraph(
}
armnn::Status status;
VLOG(DRIVER) << "ArmnnPreparedModel::ExecuteGraph m_AsyncModelExecutionEnabled false";
- status = m_Runtime->EnqueueWorkload(m_NetworkId, inputTensors, outputTensors);
+
+ std::vector<armnn::ImportedInputId> importedInputIds;
+ importedInputIds = m_Runtime->ImportInputs(m_NetworkId, inputTensors, armnn::MemorySource::Malloc);
+
+ std::vector<armnn::ImportedOutputId> importedOutputIds;
+ importedOutputIds = m_Runtime->ImportOutputs(m_NetworkId, outputTensors, armnn::MemorySource::Malloc);
+
+ status = m_Runtime->EnqueueWorkload(m_NetworkId, inputTensors, outputTensors,
+ importedInputIds, importedOutputIds);
if (ctx.measureTimings == MeasureTiming::YES)
{