aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrancis Murtagh <francis.murtagh@arm.com>2020-10-27 15:20:40 +0000
committerFrancis Murtagh <francis.murtagh@arm.com>2020-10-27 15:21:15 +0000
commitbf18a266bf5d0fe74db7cca0f54fb1ae25869da8 (patch)
tree643adcca049114a83e67e4fbf7029bfe8ec9028e /tests
parent62483bee640e7d8accf6ac77b24c6e9828841851 (diff)
downloadarmnn-bf18a266bf5d0fe74db7cca0f54fb1ae25869da8.tar.gz
Bugfix: Allow use of dynamic backendId in execute network
* Stops execute network rejecting backendId based on BackendRegistry * Dynamically loaded backends arent visible yet as runtime isn't initialized Change-Id: I87adfd137b2225ab07f8c3e996db9565caf276eb Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ExecuteNetwork/ExecuteNetworkParams.cpp20
-rw-r--r--tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp1
2 files changed, 13 insertions, 8 deletions
diff --git a/tests/ExecuteNetwork/ExecuteNetworkParams.cpp b/tests/ExecuteNetwork/ExecuteNetworkParams.cpp
index c298bd614a..ccf80648fe 100644
--- a/tests/ExecuteNetwork/ExecuteNetworkParams.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetworkParams.cpp
@@ -125,14 +125,18 @@ void CheckClTuningParameter(const int& tuningLevel,
void ExecuteNetworkParams::ValidateParams()
{
- // Check compute devices
- std::string invalidBackends;
- if (!CheckRequestedBackendsAreValid(m_ComputeDevices, armnn::Optional<std::string&>(invalidBackends)))
- {
- throw armnn::InvalidArgumentException(fmt::format("Some of the requested compute devices are invalid. "
- "\nInvalid devices: {} \nAvailable devices are: {}",
- invalidBackends,
- armnn::BackendRegistryInstance().GetBackendIdsAsString()));
+ if (m_DynamicBackendsPath=="")
+ {
+ // Check compute devices are valid unless they are dynamically loaded at runtime
+ std::string invalidBackends;
+ if (!CheckRequestedBackendsAreValid(m_ComputeDevices, armnn::Optional<std::string&>(invalidBackends)))
+ {
+ throw armnn::InvalidArgumentException(
+ fmt::format("Some of the requested compute devices are invalid. "
+ "\nInvalid devices: {} \nAvailable devices are: {}",
+ invalidBackends,
+ armnn::BackendRegistryInstance().GetBackendIdsAsString()));
+ }
}
CheckClTuningParameter(m_TuningLevel, m_TuningPath, m_ComputeDevices);
diff --git a/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp b/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp
index 8434adf691..72b784c72e 100644
--- a/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp
@@ -371,6 +371,7 @@ void ProgramOptions::ParseOptions(int ac, const char* av[])
ParseStringList(GetOptionValue<std::string>("write-outputs-to-file", m_CxxResult), ",");
m_ExNetParams.m_GenerateTensorData =
m_ExNetParams.m_InputTensorDataFilePaths.empty();
+ m_ExNetParams.m_DynamicBackendsPath = m_RuntimeOptions.m_DynamicBackendsPath;
// Parse input tensor shape from the string we got from the command-line.
std::vector<std::string> inputTensorShapesVector =