aboutsummaryrefslogtreecommitdiff
path: root/tests/Utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Utils.h')
-rw-r--r--tests/Utils.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/Utils.h b/tests/Utils.h
index f3622cafaa..b2d4bf4f90 100644
--- a/tests/Utils.h
+++ b/tests/Utils.h
@@ -38,6 +38,10 @@
#include <string>
#include <type_traits>
+#if ARM_COMPUTE_ENABLE_FP16
+#include <arm_fp16.h> // needed for float16_t
+#endif
+
namespace arm_compute
{
namespace test
@@ -362,6 +366,10 @@ 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
+
template <typename T>
using promote_t = typename promote<T>::type;
@@ -513,11 +521,11 @@ void store_value_with_data_type(void *ptr, T value, DataType data_type)
case DataType::S64:
*reinterpret_cast<int64_t *>(ptr) = value;
break;
-#ifdef ENABLE_FP16
+#if ARM_COMPUTE_ENABLE_FP16
case DataType::F16:
*reinterpret_cast<float16_t *>(ptr) = value;
break;
-#endif /* ENABLE_FP16 */
+#endif /* ARM_COMPUTE_ENABLE_FP16 */
case DataType::F32:
*reinterpret_cast<float *>(ptr) = value;
break;