diff options
-rw-r--r-- | include/armnn/IRuntime.hpp | 6 | ||||
-rw-r--r-- | shim/sl/canonical/ArmnnPreparedModel.cpp | 10 |
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) { |