COMPMID-1621 Deconvolution wrong output calculation

Change-Id: Ida71312bcf6dbd854f2ab1efc65f74910c79e152
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/151510
Tested-by: bsgcomp <bsgcomp@arm.com>
Reviewed-by: Michele DiGiorgio <michele.digiorgio@arm.com>
diff --git a/arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h b/arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h
index 4dce1e1..6716cd6 100644
--- a/arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h
+++ b/arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h
@@ -27,6 +27,8 @@
 #include "arm_compute/runtime/CL/functions/CLConvolutionLayer.h"
 #include "arm_compute/runtime/CL/functions/CLDeconvolutionLayerUpsample.h"
 
+#include "arm_compute/core/CPP/kernels/CPPFlipWeightsKernel.h"
+
 #include "arm_compute/runtime/CL/CLMemoryGroup.h"
 #include "arm_compute/runtime/CL/CLTensor.h"
 #include "arm_compute/runtime/IFunction.h"
@@ -62,6 +64,14 @@
 public:
     /** Constructor */
     CLDeconvolutionLayer(std::shared_ptr<IMemoryManager> memory_manager = nullptr);
+    /** Prevent instances of this class from being copied (As this class contains pointers) */
+    CLDeconvolutionLayer(const CLDeconvolutionLayer &) = delete;
+    /** Default move constructor */
+    CLDeconvolutionLayer(CLDeconvolutionLayer &&) = default;
+    /** Prevent instances of this class from being copied (As this class contains pointers) */
+    CLDeconvolutionLayer &operator=(const CLDeconvolutionLayer &) = delete;
+    /** Default move assignment operator */
+    CLDeconvolutionLayer &operator=(CLDeconvolutionLayer &&) = default;
     /** Set the input, weights, biases and output tensors.
      *
      * @param[in,out] input              Input tensor. 3 lower dimensions represent a single input, and an optional 4th dimension for batch of inputs. Data types supported: QASYMM8/F16/F32.
@@ -74,7 +84,7 @@
      * @param[in]     weights_info       (Optional) Weights information needed for @ref CLConvolutionLayer, specifies if the weights tensor has been reshaped with @ref CLWeightsReshapeKernel.
      *
      */
-    void configure(ICLTensor *input, const ICLTensor *weights, const ICLTensor *bias, ICLTensor *output, const PadStrideInfo &info,
+    void configure(ICLTensor *input, ICLTensor *weights, const ICLTensor *bias, ICLTensor *output, const PadStrideInfo &info,
                    unsigned int inner_border_right, unsigned int inner_border_top, const WeightsInfo &weights_info = WeightsInfo());
     /** Static function to check if given info will lead to a valid configuration of @ref CLDeconvolutionLayer
      *
@@ -100,7 +110,10 @@
     CLMemoryGroup                _memory_group;
     CLDeconvolutionLayerUpsample _scale_f;
     CLConvolutionLayer           _conv_f;
+    CPPFlipWeightsKernel         _flip_weights;
     CLTensor                     _scaled_output;
+    ICLTensor                   *_weights;
+    CLTensor                     _weights_flipped;
     bool                         _is_prepared;
 };
 }
diff --git a/arm_compute/runtime/NEON/functions/NEDeconvolutionLayer.h b/arm_compute/runtime/NEON/functions/NEDeconvolutionLayer.h
index 3e52716..0cca555 100644
--- a/arm_compute/runtime/NEON/functions/NEDeconvolutionLayer.h
+++ b/arm_compute/runtime/NEON/functions/NEDeconvolutionLayer.h
@@ -28,6 +28,7 @@
 #include "arm_compute/runtime/NEON/functions/NEConvolutionLayer.h"
 #include "arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h"
 
+#include "arm_compute/core/CPP/kernels/CPPFlipWeightsKernel.h"
 #include "arm_compute/core/Types.h"
 #include "arm_compute/runtime/IFunction.h"
 #include "arm_compute/runtime/IMemoryManager.h"
@@ -111,12 +112,14 @@
     void prepare() override;
 
 private:
-    MemoryGroup        _memory_group;
-    NEConvolutionLayer _conv_f;
-    CPPUpsample        _upsample_f;
-    Tensor             _scaled_output;
-    ITensor           *_input;
-    PadStrideInfo      _info;
+    MemoryGroup          _memory_group;
+    NEConvolutionLayer   _conv_f;
+    CPPUpsample          _upsample_f;
+    CPPFlipWeightsKernel _flip_weights;
+    Tensor               _scaled_output;
+    Tensor               _weights_flipped;
+    ITensor             *_input;
+    PadStrideInfo        _info;
     std::pair<unsigned int, unsigned int> _inner_border;
     bool _is_prepared;
 };