COMPMID-1018 - Add Winograd support in VGG16 and Alexnet examples

Change-Id: I4a2deee9e4b2c54ea79d2895cfeca44190133b24
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/125453
Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
diff --git a/examples/graph_alexnet.cpp b/examples/graph_alexnet.cpp
index a396c76..f887f97 100644
--- a/examples/graph_alexnet.cpp
+++ b/examples/graph_alexnet.cpp
@@ -57,8 +57,10 @@
         const int  int_target_hint = argc > 1 ? std::strtol(argv[1], nullptr, 10) : 0;
         TargetHint target_hint     = set_target_hint(int_target_hint);
 
-        const bool            is_gemm_convolution5x5 = Graph::gpu_target() == arm_compute::GPUTarget::MIDGARD || target_hint == TargetHint::NEON;
-        ConvolutionMethodHint convolution_5x5_hint   = is_gemm_convolution5x5 ? ConvolutionMethodHint::GEMM : ConvolutionMethodHint::DIRECT;
+        const bool            is_gemm_convolution5x5     = Graph::gpu_target() == arm_compute::GPUTarget::MIDGARD || target_hint == TargetHint::NEON;
+        const bool            is_winograd_convolution3x3 = target_hint == TargetHint::OPENCL;
+        ConvolutionMethodHint convolution_5x5_hint       = is_gemm_convolution5x5 ? ConvolutionMethodHint::GEMM : ConvolutionMethodHint::DIRECT;
+        ConvolutionMethodHint convolution_3x3_hint       = is_winograd_convolution3x3 ? ConvolutionMethodHint::WINOGRAD : ConvolutionMethodHint::GEMM;
 
         // Parse arguments
         if(argc < 2)
@@ -114,7 +116,7 @@
               << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
               << NormalizationLayer(NormalizationLayerInfo(NormType::CROSS_MAP, 5, 0.0001f, 0.75f))
               << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0)))
-              << ConvolutionMethodHint::GEMM
+              << convolution_3x3_hint
               // Layer 3
               << ConvolutionLayer(
                   3U, 3U, 384U,
diff --git a/examples/graph_vgg16.cpp b/examples/graph_vgg16.cpp
index faaf579..516b7b1 100644
--- a/examples/graph_vgg16.cpp
+++ b/examples/graph_vgg16.cpp
@@ -71,8 +71,10 @@
         bool      enable_memory_management = true;
 
         // Check if we can use GEMM-based convolutions evaluating if the platform has at least 1.8 GB of available memory
-        const size_t      memory_required  = 1932735283L;
-        ConvolutionMethod convolution_hint = convolution_hint_vgg16(memory_required);
+        const size_t      memory_required           = 1932735283L;
+        const bool        is_opencl                 = target_hint == Target::CL;
+        ConvolutionMethod first_convolution3x3_hint = is_opencl ? ConvolutionMethod::DIRECT : ConvolutionMethod::GEMM;
+        ConvolutionMethod convolution3x3_hint       = is_opencl ? ConvolutionMethod::WINOGRAD : convolution_hint_vgg16(memory_required);
 
         // Parse arguments
         if(argc < 2)
@@ -107,7 +109,7 @@
         }
 
         graph << target_hint
-              << convolution_hint
+              << first_convolution3x3_hint
               << InputLayer(TensorDescriptor(TensorShape(224U, 224U, 3U, 1U), DataType::F32),
                             get_input_accessor(image, std::move(preprocessor)))
               // Layer 1
@@ -117,6 +119,7 @@
                   get_weights_accessor(data_path, "/cnn_data/vgg16_model/conv1_1_b.npy"),
                   PadStrideInfo(1, 1, 1, 1))
               << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
+              << convolution3x3_hint
               // Layer 2
               << ConvolutionLayer(
                   3U, 3U, 64U,