From b28f29d5f5657b606921faf4c6dcc2ced1465cc7 Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Thu, 9 Nov 2017 17:05:07 +0000 Subject: COMPMID-652 - Graph examples shouldn't need to link against OpenCL - Added --no-allow-shlib-undefined to library builds to make sure we don't leave any unresolved symbol - Added --allow-shlib-undefined to the graph examples build lines so that it doesn't matter whether or not OpenCL is supported by the Graph librarylibrary - Don't link tests statically anymore on Android (This was probably required in the past because we were duplicating symbols in the core and runtime libraries, but it doesn't seem to be an issue anymore) - Updated Doxygen accordingly Change-Id: I9905f388e0838bc8e3369de52838bf980b992ead Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95172 Tested-by: Kaizen Reviewed-by: Georgios Pinitas --- src/graph/Graph.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/graph/Graph.cpp') diff --git a/src/graph/Graph.cpp b/src/graph/Graph.cpp index b86330b658..ac5316f55e 100644 --- a/src/graph/Graph.cpp +++ b/src/graph/Graph.cpp @@ -28,6 +28,7 @@ #include "arm_compute/graph/INode.h" #include "arm_compute/graph/ITensorObject.h" #include "arm_compute/graph/Tensor.h" +#include "arm_compute/runtime/CL/CLScheduler.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/Tensor.h" #include "support/ToolchainSupport.h" @@ -75,6 +76,11 @@ Graph::~Graph() //NOLINT Graph::Graph() : _pimpl{ new Private() } { + // Check if OpenCL is available and initialize the scheduler + if(opencl_is_available()) + { + arm_compute::CLScheduler::get().default_init(); + } } void Graph::run() @@ -209,6 +215,10 @@ void Graph::add_tensor_object(std::unique_ptr tensor) _pimpl->_graph_output->allocate(); } } +bool Graph::opencl_is_available() +{ + return arm_compute::opencl_is_available(); +} void Graph::set_temp(TensorInfo &&tmp) { -- cgit v1.2.1