aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/reference
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2018-10-19 15:46:19 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:55:45 +0000
commite6dbde0128bf33b5d72a00c480bd92c290fd17b7 (patch)
tree1e5f501a536b7b991ff54430f377b37e37d6d929 /tests/validation/reference
parentbcf8a968da4b26926df8bb770df16d82146bcb54 (diff)
downloadComputeLibrary-e6dbde0128bf33b5d72a00c480bd92c290fd17b7.tar.gz
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 <pablo.tello@arm.com> Tested-by: bsgcomp <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/reference')
-rw-r--r--tests/validation/reference/WidthConcatenateLayer.cpp20
1 files changed, 12 insertions, 8 deletions
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<T> widthconcatenate_layer(const std::vector<SimpleTensor<T>> &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;
+ }
}
}