diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-02-26 09:58:13 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-03-05 15:15:15 +0000 |
commit | e8291acc1d9e89c9274d31f0d5bb4779eb95588c (patch) | |
tree | 5a0fef36d6daabe387174e55b60de54557c75291 /support/ToolchainSupport.h | |
parent | aa85cdf22802cb892d7fa422ca505a43d84adb38 (diff) | |
download | ComputeLibrary-e8291acc1d9e89c9274d31f0d5bb4779eb95588c.tar.gz |
COMPMID-3152: Initial Bfloat16 support
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Ie6959e37e13731c86b2ee29392a99a293450a1b4
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2824
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Diffstat (limited to 'support/ToolchainSupport.h')
-rw-r--r-- | support/ToolchainSupport.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h index f90d65c9d9..923a9cbfe0 100644 --- a/support/ToolchainSupport.h +++ b/support/ToolchainSupport.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 ARM Limited. + * Copyright (c) 2017-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -39,6 +39,7 @@ #include <arm_neon.h> #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC +#include "support/Bfloat16.h" #include "support/Half.h" namespace arm_compute @@ -428,6 +429,12 @@ inline __fp16 lowest<__fp16>() } #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ +template <> +inline bfloat16 lowest<bfloat16>() +{ + return bfloat16::lowest(); +} + // std::isfinite template <typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type> inline bool isfinite(T value) @@ -439,6 +446,11 @@ inline bool isfinite(half_float::half value) { return half_float::isfinite(value); } + +inline bool isfinite(bfloat16 value) +{ + return std::isfinite(float(value)); +} } // namespace cpp11 namespace cpp14 |