From 5e96be7707a571b136dc64256af399dbbb0fdfe0 Mon Sep 17 00:00:00 2001 From: Vidhya Sudhan Loganathan Date: Tue, 18 Dec 2018 14:17:00 +0000 Subject: COMPMID-1722 : CL: Implement Range Change-Id: I88da6eb5289c303b1dc91606c1560ce629746058 Reviewed-on: https://review.mlplatform.org/381 Reviewed-by: Gian Marco Iodice Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas --- arm_compute/core/utils/misc/Utility.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'arm_compute/core/utils') diff --git a/arm_compute/core/utils/misc/Utility.h b/arm_compute/core/utils/misc/Utility.h index 37c8b66e06..8dd9afd5cd 100644 --- a/arm_compute/core/utils/misc/Utility.h +++ b/arm_compute/core/utils/misc/Utility.h @@ -80,8 +80,10 @@ std::array::value_type, N> make_array(It * * @return Clamped value. */ -template -inline T clamp(const T &n, const T &lower, const T &upper) +template +inline DataType clamp(const DataType &n, + const DataType &lower = std::numeric_limits::lowest(), + const DataType &upper = std::numeric_limits::max()) { return std::max(lower, std::min(n, upper)); } -- cgit v1.2.1