From 0c34fe29c298057091d48cde332cb60bb14efee1 Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Mon, 26 Jun 2017 17:17:42 +0100 Subject: COMPMID-421: Added FP16 support in Pooling Layer Change-Id: I6b6119c8770051c1656da40aa073c539c15b493e Reviewed-on: http://mpd-gerrit.cambridge.arm.com/78985 Reviewed-by: Moritz Pflanzer Tested-by: Kaizen --- tests/validation/TensorOperations.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tests/validation/TensorOperations.h') diff --git a/tests/validation/TensorOperations.h b/tests/validation/TensorOperations.h index 67dadd6da3..b8e5a6678c 100644 --- a/tests/validation/TensorOperations.h +++ b/tests/validation/TensorOperations.h @@ -44,6 +44,26 @@ #include #include +#if ARM_COMPUTE_ENABLE_FP16 +//Beware! most std templates acting on types don't work with the data type float16_t +namespace std +{ +template <> +class numeric_limits +{ +public: + static float16_t lowest() + { + return -std::numeric_limits::max(); // -inf + }; + static float16_t max() + { + return std::numeric_limits::max(); // +inf + }; +}; +} +#endif /* ARM_COMPUTE_ENABLE_FP16 */ + namespace arm_compute { namespace test @@ -1476,7 +1496,7 @@ void pooling_layer(const Tensor &in, Tensor &out, PoolingLayerInfo pool_in { for(int x = wstart; x < wend; ++x) { - T val = in[r * h_in * w_in + y * w_in + x]; + const T val = in[r * h_in * w_in + y * w_in + x]; if(val > max_val) { max_val = val; -- cgit v1.2.1