aboutsummaryrefslogtreecommitdiff
path: root/examples/graph_squeezenet.cpp
diff options
context:
space:
mode:
authorIsabella Gottardi <isabella.gottardi@arm.com>2017-11-09 17:05:07 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commitb28f29d5f5657b606921faf4c6dcc2ced1465cc7 (patch)
tree34560537d03f9766af55b470cd4344b8339c7817 /examples/graph_squeezenet.cpp
parenta3b1b469276b10484cd45901ae3a4b48b506caa9 (diff)
downloadComputeLibrary-b28f29d5f5657b606921faf4c6dcc2ced1465cc7.tar.gz
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 <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'examples/graph_squeezenet.cpp')
-rw-r--r--examples/graph_squeezenet.cpp14
1 files changed, 4 insertions, 10 deletions
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 <cstdlib>
-#include <iostream>
-#include <memory>
#include <tuple>
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(