aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/reference/Utils.h
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2018-04-23 16:11:45 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:54 +0000
commit764b1af5f41749624c3900fc65c9dad3b1adf98c (patch)
tree9d8397de05d86eb40959d24058939c46c36f0d39 /tests/validation/reference/Utils.h
parent3ca9786fe8ed00ad03963cae6a9eef7bb2fe630e (diff)
downloadComputeLibrary-764b1af5f41749624c3900fc65c9dad3b1adf98c.tar.gz
COMPMID-1070: Rewrote im2col nhwc reference
The new reference computes directly the results without the need of using temporary tensors and perform permutations which is problematic for big 4k tensors as we get bad_alloc execptions. Change-Id: I1fb0a495c4e9ca3356de76c9298832db8ace794a Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/128683 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/validation/reference/Utils.h')
-rw-r--r--tests/validation/reference/Utils.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/validation/reference/Utils.h b/tests/validation/reference/Utils.h
index 2aa77c6ff7..0e98bbe82b 100644
--- a/tests/validation/reference/Utils.h
+++ b/tests/validation/reference/Utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -62,11 +62,13 @@ T tensor_elem_at(const SimpleTensor<T> &src, Coordinates coord, BorderMode borde
{
const int x = coord.x();
const int y = coord.y();
+ const int z = coord.z();
const int width = src.shape().x();
const int height = src.shape().y();
+ const int depth = src.shape().z();
// If coordinates beyond range of tensor's width or height
- if(x < 0 || y < 0 || x >= width || y >= height)
+ if(x < 0 || y < 0 || z < 0 || x >= width || y >= height || z >= depth)
{
if(border_mode == BorderMode::REPLICATE)
{