aboutsummaryrefslogtreecommitdiff
path: root/examples/graph_mobilenet.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-01-02 13:27:37 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:42:33 +0000
commit1250a5a259962514d31bb5f8148f1d0f0a82b946 (patch)
treea9c16daffa5228926715c805d73310b4b3c2e324 /examples/graph_mobilenet.cpp
parent7c23ad01c028f73aef0b439fc5d5d14e92e5f4e2 (diff)
downloadComputeLibrary-1250a5a259962514d31bb5f8148f1d0f0a82b946.tar.gz
COMPMID-767 : Propagate hints to subgraph.
-Propagates hints to subgraph. -Fixes dispatching of apropriate optimized DepthwiseConvolution kernel for OpenCL backend. NEON backend is altered to default to the generic case until COMPMID-769 is addressed. Change-Id: I544f05cd99a9ac253f1b19aa4e4bb222b8fdd087 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114781 Reviewed-by: Pablo Tello <pablo.tello@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'examples/graph_mobilenet.cpp')
-rw-r--r--examples/graph_mobilenet.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/graph_mobilenet.cpp b/examples/graph_mobilenet.cpp
index 0c916c7ba0..553253383f 100644
--- a/examples/graph_mobilenet.cpp
+++ b/examples/graph_mobilenet.cpp
@@ -86,7 +86,8 @@ void main_graph_mobilenet(int argc, const char **argv)
constexpr float mean_b = 104.01f; /* Mean value to subtract from blue channel */
// Set target. 0 (NEON), 1 (OpenCL). By default it is NEON
- TargetHint target_hint = set_target_hint(argc > 1 ? std::strtol(argv[1], nullptr, 10) : 0);
+ TargetHint target_hint = set_target_hint(argc > 1 ? std::strtol(argv[1], nullptr, 10) : 0);
+ ConvolutionMethodHint convolution_hint = target_hint == TargetHint::NEON ? ConvolutionMethodHint::GEMM : ConvolutionMethodHint::DIRECT;
// Parse arguments
if(argc < 2)
@@ -125,6 +126,7 @@ void main_graph_mobilenet(int argc, const char **argv)
graph << target_hint
<< Tensor(TensorInfo(TensorShape(224U, 224U, 3U, 1U), 1, DataType::F32),
get_input_accessor(image, mean_r, mean_g, mean_b))
+ << convolution_hint
<< ConvolutionLayer(
3U, 3U, 32U,
get_weights_accessor(data_path, "/cnn_data/mobilenet_v1_model/Conv2d_0_weights.npy"),