COMPMID-1432: Enable by default NHWC in graph examples

Change-Id: I2240b6a6430cb1d261458343b2900cc1f16ac414
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/141861
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
diff --git a/examples/graph_alexnet.cpp b/examples/graph_alexnet.cpp
index 944a435..8394587 100644
--- a/examples/graph_alexnet.cpp
+++ b/examples/graph_alexnet.cpp
@@ -58,6 +58,12 @@
             return false;
         }
 
+        // Set default layout if needed
+        if(!common_opts.data_layout->is_set() && common_params.target == Target::NEON)
+        {
+            common_params.data_layout = DataLayout::NCHW;
+        }
+
         // Checks
         ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "Unsupported data type!");
 
diff --git a/examples/graph_inception_v3.cpp b/examples/graph_inception_v3.cpp
index c41b0a8..3d35117 100644
--- a/examples/graph_inception_v3.cpp
+++ b/examples/graph_inception_v3.cpp
@@ -58,6 +58,12 @@
             return false;
         }
 
+        // Set default layout if needed
+        if(!common_opts.data_layout->is_set() && common_params.target == Target::NEON)
+        {
+            common_params.data_layout = DataLayout::NCHW;
+        }
+
         // Checks
         ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "Unsupported data type!");
 
diff --git a/examples/graph_inception_v4.cpp b/examples/graph_inception_v4.cpp
index b61acfc..1ca8c5f 100644
--- a/examples/graph_inception_v4.cpp
+++ b/examples/graph_inception_v4.cpp
@@ -58,6 +58,12 @@
             return false;
         }
 
+        // Set default layout if needed
+        if(!common_opts.data_layout->is_set() && common_params.target == Target::NEON)
+        {
+            common_params.data_layout = DataLayout::NCHW;
+        }
+
         // Checks
         ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "Unsupported data type!");
 
diff --git a/examples/graph_mobilenet.cpp b/examples/graph_mobilenet.cpp
index d182844..a8b0f47 100644
--- a/examples/graph_mobilenet.cpp
+++ b/examples/graph_mobilenet.cpp
@@ -43,9 +43,6 @@
     GraphMobilenetExample()
         : cmd_parser(), common_opts(cmd_parser), common_params(), graph(0, "MobileNetV1")
     {
-        // Sets default layout to NHWC
-        common_opts.data_layout->parse("NHWC");
-
         // Add model id option
         model_id_opt = cmd_parser.add_option<SimpleOption<int>>("model-id", 0);
         model_id_opt->set_help("Mobilenet model id (0: 1.0_224, else: 0.75_160");
diff --git a/examples/graph_squeezenet_v1_1.cpp b/examples/graph_squeezenet_v1_1.cpp
index 631f123..bf63246 100644
--- a/examples/graph_squeezenet_v1_1.cpp
+++ b/examples/graph_squeezenet_v1_1.cpp
@@ -58,6 +58,12 @@
             return false;
         }
 
+        // Set default layout if needed
+        if(!common_opts.data_layout->is_set() && common_params.target == Target::NEON)
+        {
+            common_params.data_layout = DataLayout::NCHW;
+        }
+
         // Checks
         ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "Unsupported data type!");