diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2018-11-27 15:58:08 +0000 |
---|---|---|
committer | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2018-12-05 10:51:21 +0000 |
commit | 8aa985e6cd553f4e2cee6cab74b82fa626896299 (patch) | |
tree | 48fda6fb70698b497b45ec775a04147ce0c5c379 /arm_compute/core/Helpers.h | |
parent | 8fe103c35b351f2f2028782c74f0b619a744595e (diff) | |
download | ComputeLibrary-8aa985e6cd553f4e2cee6cab74b82fa626896299.tar.gz |
COMPMID-1725: Implement Pack
Change-Id: I13f6e4c600f39355f69e015409bf30dafdc5e3aa
Reviewed-on: https://review.mlplatform.org/332
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'arm_compute/core/Helpers.h')
-rw-r--r-- | arm_compute/core/Helpers.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arm_compute/core/Helpers.h b/arm_compute/core/Helpers.h index ef59323073..8f4220fb80 100644 --- a/arm_compute/core/Helpers.h +++ b/arm_compute/core/Helpers.h @@ -710,6 +710,18 @@ inline Size2D compute_winograd_convolution_tiles(const Size2D &in_dims, const Si return Size2D(num_tiles_x, num_tiles_y); } +/** Wrap-around a number within the range 0 <= x < m + * + * @param[in] x Input value + * @param[in] m Range + * + * @return the wrapped-around number + */ +template <typename T> +inline T wrap_around(T x, T m) +{ + return x >= 0 ? x % m : (x % m + m) % m; +} } // namespace arm_compute #include "arm_compute/core/Helpers.inl" |