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 --- examples/graph_squeezenet.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'examples/graph_squeezenet.cpp') diff --git a/examples/graph_squeezenet.cpp b/examples/graph_squeezenet.cpp index d38cec28c4..51c4de0ec1 100644 --- a/examples/graph_squeezenet.cpp +++ b/examples/graph_squeezenet.cpp @@ -21,22 +21,15 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_CL /* Needed by Utils.cpp to handle OpenCL exceptions properly */ -#error "This example needs to be built with -DARM_COMPUTE_CL" -#endif /* ARM_COMPUTE_CL */ #include "arm_compute/graph/Graph.h" #include "arm_compute/graph/Nodes.h" #include "arm_compute/graph/SubGraph.h" -#include "arm_compute/runtime/CL/CLScheduler.h" -#include "arm_compute/runtime/Scheduler.h" #include "support/ToolchainSupport.h" #include "utils/GraphUtils.h" #include "utils/Utils.h" #include -#include -#include #include using namespace arm_compute::graph; @@ -109,14 +102,15 @@ void main_graph_squeezenet(int argc, const char **argv) } // Check if OpenCL is available and initialize the scheduler - if(arm_compute::opencl_is_available()) + TargetHint hint = TargetHint::NEON; + if(Graph::opencl_is_available()) { - arm_compute::CLScheduler::get().default_init(); + hint = TargetHint::OPENCL; } Graph graph; - graph << TargetHint::OPENCL + graph << hint << Tensor(TensorInfo(TensorShape(224U, 224U, 3U, 1U), 1, DataType::F32), get_input_accessor(image, mean_r, mean_g, mean_b)) << ConvolutionLayer( -- cgit v1.2.1