aboutsummaryrefslogtreecommitdiff
path: root/tests/Utils.h
diff options
context:
space:
mode:
authorMoritz Pflanzer <moritz.pflanzer@arm.com>2017-07-21 15:55:28 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:16:42 +0100
commite49e26613264842f91d29a32be3a226a0d6adb42 (patch)
tree78d88bded1f178d06b9dbfe3950ba716ef229599 /tests/Utils.h
parent27b386cb7596542a3296c32e41f7a5168b4d53be (diff)
downloadComputeLibrary-e49e26613264842f91d29a32be3a226a0d6adb42.tar.gz
COMPMID-415: Use half_float library for F16
3RDPARTY_UPDATE Change-Id: Iee572e18d5b1df71300d738cc8690f49d7203d5c Reviewed-on: http://mpd-gerrit.cambridge.arm.com/81353 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/Utils.h')
-rw-r--r--tests/Utils.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/tests/Utils.h b/tests/Utils.h
index ad45bffe6e..0a58d41e35 100644
--- a/tests/Utils.h
+++ b/tests/Utils.h
@@ -31,6 +31,7 @@
#include "arm_compute/core/TensorShape.h"
#include "arm_compute/core/Types.h"
#include "support/ToolchainSupport.h"
+#include "tests/validation/half.h"
#include <cmath>
#include <cstddef>
@@ -40,10 +41,6 @@
#include <string>
#include <type_traits>
-#ifdef ARM_COMPUTE_ENABLE_FP16
-#include <arm_fp16.h> // needed for float16_t
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-
namespace arm_compute
{
namespace test
@@ -100,9 +97,7 @@ template <> struct promote<int16_t> { using type = int32_t; };
template <> struct promote<uint32_t> { using type = uint64_t; };
template <> struct promote<int32_t> { using type = int64_t; };
template <> struct promote<float> { using type = float; };
-#ifdef ARM_COMPUTE_ENABLE_FP16
-template <> struct promote<float16_t> { using type = float16_t; };
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
+template <> struct promote<half_float::half> { using type = half_float::half; };
template <typename T>
@@ -248,11 +243,9 @@ void store_value_with_data_type(void *ptr, T value, DataType data_type)
case DataType::S64:
*reinterpret_cast<int64_t *>(ptr) = value;
break;
-#if ARM_COMPUTE_ENABLE_FP16
case DataType::F16:
- *reinterpret_cast<float16_t *>(ptr) = value;
+ *reinterpret_cast<half_float::half *>(ptr) = value;
break;
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
case DataType::F32:
*reinterpret_cast<float *>(ptr) = value;
break;