diff options
author | Colm Donelan <colm.donelan@arm.com> | 2022-05-30 15:20:36 +0100 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2022-06-20 15:04:10 +0000 |
commit | 03bf98a8bc51ad20eef4b9ca5fbf6ce15e063721 (patch) | |
tree | 161e9f9efdeffb72cf6237b7a67dc2e990eb97c4 /delegate | |
parent | 8f397a1efed11e17e9f8cb12b53a72b7e32ab978 (diff) | |
download | armnn-03bf98a8bc51ad20eef4b9ca5fbf6ce15e063721.tar.gz |
IVGCVSW-6873 Import inputs but don't export outputs fails.
Only one bool is used to indicate whether inputs should be imported.
However, its possible for the user to want to import inputs but not
export outputs. In addition it's possible for a user to enabled import
during optimize but then pass a memory source that does not require
import.
* Add m_ExportEnabled to INetwork.hpp.
* Modify Network::dNetwork to consider both m_ImportEnabled
and m_ExportEnabled.
* Add ValidateSourcesMatchOptimizedNetwork to LoadedNetwork to validate
import options between optimize and network load.
* Update the TfLite delegate consider exportEnabled flag in the
optimizer.
!armnn-internal-tests:425350
Signed-off-by: Colm Donelan <colm.donelan@arm.com>
Change-Id: I776eab81595898e43f91ab40306962eae61329f4
Diffstat (limited to 'delegate')
-rw-r--r-- | delegate/include/Version.hpp | 2 | ||||
-rw-r--r-- | delegate/src/armnn_delegate.cpp | 14 | ||||
-rw-r--r-- | delegate/src/test/DelegateOptionsTest.cpp | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/delegate/include/Version.hpp b/delegate/include/Version.hpp index 34555b2c6f..c14857e320 100644 --- a/delegate/include/Version.hpp +++ b/delegate/include/Version.hpp @@ -14,7 +14,7 @@ namespace armnnDelegate // ArmNN Delegate version components #define DELEGATE_MAJOR_VERSION 26 -#define DELEGATE_MINOR_VERSION 0 +#define DELEGATE_MINOR_VERSION 1 #define DELEGATE_PATCH_VERSION 0 /// DELEGATE_VERSION: "X.Y.Z" diff --git a/delegate/src/armnn_delegate.cpp b/delegate/src/armnn_delegate.cpp index bb2f3c319a..1b6d68eb7a 100644 --- a/delegate/src/armnn_delegate.cpp +++ b/delegate/src/armnn_delegate.cpp @@ -394,14 +394,20 @@ ArmnnSubgraph* ArmnnSubgraph::Create(TfLiteContext* tfLiteContext, // Load graph into runtime std::string errorMessage; armnn::Status loadingStatus; - armnn::MemorySource memorySource = armnn::MemorySource::Undefined; + armnn::MemorySource inputSource = armnn::MemorySource::Undefined; + armnn::MemorySource outputSource = armnn::MemorySource::Undefined; + // There's a bit of an assumption here that the delegate will only support Malloc memory source. if (delegate->m_Options.GetOptimizerOptions().m_ImportEnabled) { - memorySource = armnn::MemorySource::Malloc; + inputSource = armnn::MemorySource::Malloc; + } + if (delegate->m_Options.GetOptimizerOptions().m_ExportEnabled) + { + outputSource = armnn::MemorySource::Malloc; } armnn::INetworkProperties networkProperties(false, - memorySource, - memorySource, + inputSource, + outputSource, delegate->m_Options.GetInternalProfilingState(), delegate->m_Options.GetInternalProfilingDetail()); loadingStatus = delegate->m_Runtime->LoadNetwork(networkId, diff --git a/delegate/src/test/DelegateOptionsTest.cpp b/delegate/src/test/DelegateOptionsTest.cpp index 126bf30a25..c9f1530968 100644 --- a/delegate/src/test/DelegateOptionsTest.cpp +++ b/delegate/src/test/DelegateOptionsTest.cpp @@ -173,7 +173,7 @@ TEST_CASE ("ArmnnDelegateModelOptions_CpuAcc_Test") }); modelOptions.push_back(cpuAcc); - armnn::OptimizerOptions optimizerOptions(false, false, false, false, modelOptions); + armnn::OptimizerOptions optimizerOptions(false, false, false, false, modelOptions, false); armnnDelegate::DelegateOptions delegateOptions(backends, optimizerOptions); DelegateOptionTest<float>(::tflite::TensorType_FLOAT32, |