aboutsummaryrefslogtreecommitdiff
path: root/tests/TensorLibrary.h
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2017-06-23 10:40:05 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:14:20 +0100
commit383deec6b38f8b00f901d475000d46f8d3e5fb97 (patch)
treedc2e72587ea624d1b0eb06d8559af0e7783d90d0 /tests/TensorLibrary.h
parentfabb038a54ca217497c17e31ba7ae098690f2f69 (diff)
downloadComputeLibrary-383deec6b38f8b00f901d475000d46f8d3e5fb97.tar.gz
COMPMID-345: Added support for arm8.2+FP16 in the the validation framework.
Change-Id: Ifef2133d4a0da5456bec147330405b6d58cf6a71 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/78676 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/TensorLibrary.h')
-rw-r--r--tests/TensorLibrary.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/TensorLibrary.h b/tests/TensorLibrary.h
index bdf91c6eda..b05302a9b0 100644
--- a/tests/TensorLibrary.h
+++ b/tests/TensorLibrary.h
@@ -43,6 +43,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
@@ -494,10 +498,10 @@ void TensorLibrary::fill_tensor_uniform(T &&tensor, std::random_device::result_t
fill(tensor, distribution_s64, seed_offset);
break;
}
-#ifdef ENABLE_FP16
+#if ARM_COMPUTE_ENABLE_FP16
case DataType::F16:
{
- std::uniform_real_distribution<float16_t> distribution_f16(std::numeric_limits<float16_t>::lowest(), std::numeric_limits<float16_t>::max());
+ std::uniform_real_distribution<float> distribution_f16(std::numeric_limits<float16_t>::lowest(), std::numeric_limits<float16_t>::max());
fill(tensor, distribution_f16, seed_offset);
break;
}
@@ -589,11 +593,10 @@ void TensorLibrary::fill_tensor_uniform(T &&tensor, std::random_device::result_t
fill(tensor, distribution_s64, seed_offset);
break;
}
-#if ENABLE_FP16
+#if ARM_COMPUTE_ENABLE_FP16
case DataType::F16:
{
- ARM_COMPUTE_ERROR_ON(!(std::is_same<float16_t, D>::value));
- std::uniform_real_distribution<float16_t> distribution_f16(low, high);
+ std::uniform_real_distribution<float_t> distribution_f16(low, high);
fill(tensor, distribution_f16, seed_offset);
break;
}