COMPMID-1137 OpenCL concatenate width

Change-Id: I40faba421281b1cf080fa6a825d04a4366cdaeb0
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/130700
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h
index 30d3f9b..deab181 100644
--- a/arm_compute/core/utils/misc/ShapeCalculator.h
+++ b/arm_compute/core/utils/misc/ShapeCalculator.h
@@ -366,6 +366,35 @@
 
     return tensor_shape;
 }
+
+template <typename T>
+inline TensorShape get_shape_from_info(T *info)
+{
+    return info->info()->tensor_shape();
+}
+
+inline TensorShape get_shape_from_info(ITensorInfo *info)
+{
+    return info->tensor_shape();
+}
+
+template <typename T>
+inline TensorShape calculate_width_concatenate_shape(const std::vector<T *> &inputs_vector)
+{
+    TensorShape out_shape = get_shape_from_info(inputs_vector[0]);
+
+    size_t width = 0;
+    for(const auto &tensor : inputs_vector)
+    {
+        ARM_COMPUTE_ERROR_ON(tensor == nullptr);
+        const TensorShape shape = get_shape_from_info(tensor);
+        width += shape.x();
+    }
+
+    out_shape.set(0, width);
+
+    return out_shape;
+}
 } // namespace shape_calculator
 } // namespace misc
 } // namespace arm_compute