aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/Types.h
diff options
context:
space:
mode:
authorDiego Lopez Recas <Diego.LopezRecas@arm.com>2017-12-18 11:28:27 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:43:10 +0000
commitbcbc970f1f5b47f7314a5ad078820bc8a5edca94 (patch)
tree6bca70896b993adc80aea5e652d9e8dcefff3d8d /arm_compute/core/Types.h
parent1bfc7849950b67aeee382b08f27fd0b1b5ef0587 (diff)
downloadComputeLibrary-bcbc970f1f5b47f7314a5ad078820bc8a5edca94.tar.gz
IVGCVSW-863 calculate_max_window..() family takes ValidRegion
Change-Id: I91e39713ffa580e9d2213988ad3517a8a41bf4e8 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114013 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'arm_compute/core/Types.h')
-rw-r--r--arm_compute/core/Types.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h
index 538449b40a..5402e358b5 100644
--- a/arm_compute/core/Types.h
+++ b/arm_compute/core/Types.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016, 2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -165,9 +165,17 @@ struct ValidRegion
ValidRegion &operator=(ValidRegion &&) = default;
~ValidRegion() = default;
- ValidRegion(Coordinates anchor, TensorShape shape)
- : anchor{ anchor }, shape{ shape }
+ ValidRegion(const Coordinates &an_anchor, const TensorShape &a_shape)
+ : anchor{ an_anchor }, shape{ a_shape }
{
+ anchor.set_num_dimensions(std::max(anchor.num_dimensions(), shape.num_dimensions()));
+ }
+
+ ValidRegion(const Coordinates &an_anchor, const TensorShape &a_shape, size_t num_dimensions)
+ : anchor{ an_anchor }, shape{ a_shape }
+ {
+ ARM_COMPUTE_ERROR_ON(num_dimensions < std::max(anchor.num_dimensions(), shape.num_dimensions()));
+ anchor.set_num_dimensions(num_dimensions);
}
/** Return the start of the valid region for the given dimension @p d */