aboutsummaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-08-10 17:36:36 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commit3a6163ed0c2d0ab4cac0456e8f66c704c6ad10c2 (patch)
treef2e34b47fb0b8bf1fac18c337a67c0145def7b7b /support
parente3f1bd10e71075f7d8b406698809666e1eb4e7ae (diff)
downloadComputeLibrary-3a6163ed0c2d0ab4cac0456e8f66c704c6ad10c2.tar.gz
COMPMID-1499: Fixed issues to build for FP16 on Android
Change-Id: I7cd15e9115b5c6f544005528d69061751286be11 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/143708 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Michele DiGiorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'support')
-rw-r--r--support/ToolchainSupport.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h
index ece966704f..7d02e67ec6 100644
--- a/support/ToolchainSupport.h
+++ b/support/ToolchainSupport.h
@@ -315,6 +315,20 @@ inline void *align(std::size_t alignment, std::size_t size, void *&ptr, std::siz
return ptr = reinterpret_cast<void *>(aligned);
}
+// std::numeric_limits<T>::lowest
+template <typename T>
+inline T lowest()
+{
+ return std::numeric_limits<T>::lowest();
+}
+
+#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
+template <>
+inline __fp16 lowest<__fp16>()
+{
+ return std::numeric_limits<half_float::half>::lowest();
+}
+#endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
// std::isfinite
template <typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>