From e6dbde0128bf33b5d72a00c480bd92c290fd17b7 Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Fri, 19 Oct 2018 15:46:19 +0100 Subject: COMPMID-1667: Add 4D tensors support to CLWidthConcatenateLayerKernel Change-Id: Ibc0b1242804c2fdb183825406e3c78bd0d1d3564 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/154368 Reviewed-by: Pablo Tello Tested-by: bsgcomp --- tests/validation/reference/WidthConcatenateLayer.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'tests/validation/reference/WidthConcatenateLayer.cpp') diff --git a/tests/validation/reference/WidthConcatenateLayer.cpp b/tests/validation/reference/WidthConcatenateLayer.cpp index 8662199306..6be171b64d 100644 --- a/tests/validation/reference/WidthConcatenateLayer.cpp +++ b/tests/validation/reference/WidthConcatenateLayer.cpp @@ -59,20 +59,24 @@ SimpleTensor widthconcatenate_layer(const std::vector> &srcs) { ARM_COMPUTE_ERROR_ON(width_offset >= width_out); - const int width = src.shape().x(); - const int height = src.shape().y(); - const int depth = src.shape().z(); + const int width = src.shape().x(); + const int height = src.shape().y(); + const int depth = src.shape().z(); + const int upper_dims = src.shape().total_size() / (width * height * depth); const T *src_ptr = src.data(); T *dst_ptr = dst.data(); - for(int d = 0; d < depth; ++d) + for(int u = 0; u < upper_dims; ++u) { - for(int r = 0; r < height; ++r) + for(int d = 0; d < depth; ++d) { - int offset = d * height + r; - std::copy(src_ptr, src_ptr + width, dst_ptr + width_offset + offset * width_out); - src_ptr += width; + for(int r = 0; r < height; ++r) + { + const int offset = u * height * depth + d * height + r; + std::copy(src_ptr, src_ptr + width, dst_ptr + width_offset + offset * width_out); + src_ptr += width; + } } } -- cgit v1.2.1