IVGCVSW-3541 Treat an empty list of backend paths as a special case
authorMatteo Martincigh <matteo.martincigh@arm.com>
Mon, 12 Aug 2019 13:07:59 +0000 (14:07 +0100)
committerMatteo Martincigh <matteo.martincigh@arm.com>
Mon, 12 Aug 2019 14:45:30 +0000 (14:45 +0000)
 * Silently considering the dynamic backend loading feature as
   disabled if an empty list of paths is passed to ArmNN
 * This was causing problems during testing as ArmNN's output
   was containing extra unnecessary warning messages

Change-Id: I4ebda412004179817cd54494ccddc964b04b8232
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
src/backends/backendsCommon/DynamicBackendUtils.cpp

index 38ac5ad..fadec0c 100644 (file)
@@ -89,6 +89,14 @@ std::vector<std::string> DynamicBackendUtils::GetBackendPaths(const std::string&
 
 std::vector<std::string> DynamicBackendUtils::GetBackendPathsImpl(const std::string& backendPaths)
 {
+    // Check if there's any path to process at all
+    if (backendPaths.empty())
+    {
+        // Silently return without issuing a warning as no paths have been passed, so
+        // the whole dynamic backend loading feature can be considered as disabled
+        return {};
+    }
+
     std::unordered_set<std::string> uniqueBackendPaths;
     std::vector<std::string> tempBackendPaths;
     std::vector<std::string> validBackendPaths;