aboutsummaryrefslogtreecommitdiff
path: root/src/graph/Utils.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2019-02-20 18:11:42 +0000
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-02-22 15:07:23 +0000
commit7097e3c7cc7cbea7959685354cfc84c2c1823f75 (patch)
treebbc74b268430fd244665409ba862178f35d69dcf /src/graph/Utils.cpp
parent8f5802f1ee432445ed37344060ffa23916f7f29f (diff)
downloadComputeLibrary-7097e3c7cc7cbea7959685354cfc84c2c1823f75.tar.gz
COMPMID-1601: Graph examples segfaulting on some platform when gles=1
Makes the graph to setup and initialize only the backends used as some platform have issues when GLES backend get initialized but not used. Change-Id: Icf88675ffd8c2997e54a68baabfbbce241b0712c Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-on: https://review.mlplatform.org/745 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Giuseppe Rossini <giuseppe.rossini@arm.com>
Diffstat (limited to 'src/graph/Utils.cpp')
-rw-r--r--src/graph/Utils.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/graph/Utils.cpp b/src/graph/Utils.cpp
index 71ec548f8a..71a6fc582b 100644
--- a/src/graph/Utils.cpp
+++ b/src/graph/Utils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -104,13 +104,14 @@ void release_default_graph_context(GraphContext &ctx)
}
}
-void setup_default_graph_context(GraphContext &ctx)
+void setup_requested_backend_context(GraphContext &ctx, Target target)
{
- for(const auto &backend : backends::BackendRegistry::get().backends())
+ if(backends::BackendRegistry::get().contains(target))
{
- if(backend.second->is_backend_supported())
+ const auto &backend = backends::BackendRegistry::get().find_backend(target);
+ if(backend->is_backend_supported())
{
- backend.second->setup_backend_context(ctx);
+ backend->setup_backend_context(ctx);
}
}
}