aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/reference/Permute.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2019-02-21 14:47:56 +0000
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-03-12 11:21:58 +0000
commitdef2a851abd0d0e1cd748e53b7cb438be15d8f2b (patch)
tree80208efd120d3dbb1dc456ac816b2a6fd53adabe /tests/validation/reference/Permute.cpp
parent8d04fa08b1c2a71466876b832fc6c6dfaa978a40 (diff)
downloadComputeLibrary-def2a851abd0d0e1cd748e53b7cb438be15d8f2b.tar.gz
COMPMID-1960: Implement DFT reference
Change-Id: I08d47ce2cf7fc833df94420bedd69cedf080fd34 Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-on: https://review.mlplatform.org/c/822 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'tests/validation/reference/Permute.cpp')
-rw-r--r--tests/validation/reference/Permute.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/validation/reference/Permute.cpp b/tests/validation/reference/Permute.cpp
index 29c3c5cda8..619a787a05 100644
--- a/tests/validation/reference/Permute.cpp
+++ b/tests/validation/reference/Permute.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -47,11 +47,11 @@ SimpleTensor<T> permute(const SimpleTensor<T> &src, PermutationVector perm)
// Compute reference
for(int i = 0; i < src.num_elements(); ++i)
{
- Coordinates coord = index2coord(src.shape(), i);
- permute(coord, perm);
- const size_t dst_index = coord2index(dst.shape(), coord);
+ const Coordinates src_coords = index2coord(src.shape(), i);
+ Coordinates dst_coords = src_coords;
+ permute(dst_coords, perm);
- dst[dst_index] = src[i];
+ std::copy_n(static_cast<const T *>(src(src_coords)), src.num_channels(), static_cast<T *>(dst(dst_coords)));
}
return dst;