aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/utils/misc/ShapeCalculator.h
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2018-08-23 12:00:02 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commit226e4b92b191491ffa57ede66eba1d5d6fcf3b76 (patch)
tree334705a1e743e3465400208d582cf0b25bf950fa /arm_compute/core/utils/misc/ShapeCalculator.h
parent35aea3776449557c438e264bae7af5b1fe0e5ff6 (diff)
downloadComputeLibrary-226e4b92b191491ffa57ede66eba1d5d6fcf3b76.tar.gz
COMPMID-1470 Add auto-init of the output in NECol2im
The output of NECol2Im is already auto-initialized. This patch is about calling ShapeCalculator instead of computing the shape inside the kernel, adding validate_and_configure_window, and standardize the way convolved dims are passed (now NEON uses Size2D, while CL passes a pair of uint values: using Size2D for both implementations) Change-Id: I795696e1b6532f57847c3186c1b532c09f5a25da Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/145345 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Michele DiGiorgio <michele.digiorgio@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/core/utils/misc/ShapeCalculator.h')
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h
index c40e7119b2..09f558d8b0 100644
--- a/arm_compute/core/utils/misc/ShapeCalculator.h
+++ b/arm_compute/core/utils/misc/ShapeCalculator.h
@@ -141,18 +141,18 @@ inline TensorShape compute_reductionB_shape(const ITensorInfo &a)
return shape_vector_sum_row;
}
-inline TensorShape compute_col2im_shape(const ITensorInfo &input, std::pair<unsigned int, unsigned int> convolved_dims, unsigned int num_groups = 1)
+inline TensorShape compute_col2im_shape(const ITensorInfo &input, const Size2D &convolved_dims, bool batch_size_on_z, unsigned int num_groups = 1)
{
ARM_COMPUTE_ERROR_ON(num_groups == 0);
- ARM_COMPUTE_ERROR_ON(input.tensor_shape()[1] != (convolved_dims.first * convolved_dims.second));
+ ARM_COMPUTE_ERROR_ON(input.tensor_shape()[1] != (convolved_dims.area()));
ARM_COMPUTE_ERROR_ON((num_groups > 1) && input.tensor_shape()[2] != num_groups);
TensorShape col2im_shape{ input.tensor_shape() };
- col2im_shape.set(0, convolved_dims.first);
- col2im_shape.set(1, convolved_dims.second);
+ col2im_shape.set(0, convolved_dims.width);
+ col2im_shape.set(1, convolved_dims.height);
col2im_shape.set(2, input.tensor_shape()[0] * num_groups);
- const unsigned int batch_idx = (num_groups == 1) ? 2 : 3;
+ const unsigned int batch_idx = (batch_size_on_z && num_groups == 1) ? 2 : 3;
col2im_shape.set(3, input.tensor_shape()[batch_idx]);
return col2im_shape;