From 91654c45cf1de5f41127536a0fdd310c17fdfc8e Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Wed, 5 Jul 2017 11:32:17 +0100 Subject: COMPMID-421: Added FP16 support in ActivationLayer. Change-Id: I7ba573b19d56e3c87996edb5218a00e5bfca451e Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79755 Reviewed-by: Anthony Barbier Tested-by: Kaizen --- tests/validation/Helpers.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tests/validation/Helpers.h') diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h index 4ee2112bcc..191e32813c 100644 --- a/tests/validation/Helpers.h +++ b/tests/validation/Helpers.h @@ -35,6 +35,10 @@ #include #include +#ifdef ARM_COMPUTE_ENABLE_FP16 +#include +#endif /* ARM_COMPUTE_ENABLE_FP16 */ + namespace arm_compute { namespace test @@ -49,9 +53,13 @@ namespace validation * @return A pair containing the lower upper testing bounds for a given function. */ template -std::pair get_activation_layer_test_bounds(ActivationLayerInfo::ActivationFunction activation, int fixed_point_position = 1) +inline std::pair get_activation_layer_test_bounds(ActivationLayerInfo::ActivationFunction activation, int fixed_point_position = 1) { - bool is_float = std::is_floating_point::value; + bool is_float = std::is_same::value; +#ifdef ARM_COMPUTE_ENABLE_FP16 + is_float = is_float || std::is_same::value; +#endif /* ARM_COMPUTE_ENABLE_FP16 */ + std::pair bounds; // Set initial values @@ -98,7 +106,6 @@ std::pair get_activation_layer_test_bounds(ActivationLayerInfo::Activation } return bounds; } - /** Helper function to get the testing range for batch normalization layer. * * @param[in] fixed_point_position (Optional) Number of bits for the fractional part. Defaults to 1. -- cgit v1.2.1