diff options
author | Felix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com> | 2023-09-27 17:46:17 +0100 |
---|---|---|
committer | felixjohnny.thomasmathibalan <felixjohnny.thomasmathibalan@arm.com> | 2023-09-28 12:08:05 +0000 |
commit | afd38f0c617d6f89b2b4532c6c44f116617e2b6f (patch) | |
tree | 03bc7d5a762099989b16a656fa8d397b490ed70e /arm_compute/core/utils/math | |
parent | bdcb4c148ee2fdeaaddf4cf1e57bbb0de02bb894 (diff) | |
download | ComputeLibrary-afd38f0c617d6f89b2b4532c6c44f116617e2b6f.tar.gz |
Apply clang-format on repository
Code is formatted as per a revised clang format configuration
file(not part of this delivery). Version 14.0.6 is used.
Exclusion List:
- files with .cl extension
- files that are not strictly C/C++ (e.g. Android.bp, Sconscript ...)
And the following directories
- compute_kernel_writer/validation/
- tests/
- include/
- src/core/NEON/kernels/convolution/
- src/core/NEON/kernels/arm_gemm/
- src/core/NEON/kernels/arm_conv/
- data/
There will be a follow up for formatting of .cl files and the
files under tests/ and compute_kernel_writer/validation/.
Signed-off-by: Felix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com>
Change-Id: Ib7eb1fcf4e7537b9feaefcfc15098a804a3fde0a
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10391
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Diffstat (limited to 'arm_compute/core/utils/math')
-rw-r--r-- | arm_compute/core/utils/math/Math.h | 2 | ||||
-rw-r--r-- | arm_compute/core/utils/math/SafeOps.h | 23 |
2 files changed, 13 insertions, 12 deletions
diff --git a/arm_compute/core/utils/math/Math.h b/arm_compute/core/utils/math/Math.h index c1dce7ff08..e70337ba0f 100644 --- a/arm_compute/core/utils/math/Math.h +++ b/arm_compute/core/utils/math/Math.h @@ -67,5 +67,5 @@ inline auto floor_to_multiple(S value, T divisor) -> decltype((value / divisor) return (value / divisor) * divisor; } -} +} // namespace arm_compute #endif /*ARM_COMPUTE_UTILS_MATH_H */ diff --git a/arm_compute/core/utils/math/SafeOps.h b/arm_compute/core/utils/math/SafeOps.h index dc928a0e5d..ef8bcf7e14 100644 --- a/arm_compute/core/utils/math/SafeOps.h +++ b/arm_compute/core/utils/math/SafeOps.h @@ -25,6 +25,7 @@ #define ARM_COMPUTE_UTILS_MATH_SAFE_OPS #include "arm_compute/core/Error.h" + #include "support/AclRequires.h" #include <limits> @@ -51,11 +52,11 @@ T safe_integer_add(T val_a, T val_b) { T result = 0; - if((val_b > 0) && (val_a > std::numeric_limits<T>::max() - val_b)) + if ((val_b > 0) && (val_a > std::numeric_limits<T>::max() - val_b)) { result = std::numeric_limits<T>::max(); } - else if((val_b < 0) && (val_a < std::numeric_limits<T>::min() - val_b)) + else if ((val_b < 0) && (val_a < std::numeric_limits<T>::min() - val_b)) { result = std::numeric_limits<T>::min(); } @@ -83,11 +84,11 @@ T safe_integer_sub(T val_a, T val_b) { T result = 0; - if((val_b < 0) && (val_a > std::numeric_limits<T>::max() + val_b)) + if ((val_b < 0) && (val_a > std::numeric_limits<T>::max() + val_b)) { result = std::numeric_limits<T>::max(); } - else if((val_b > 0) && (val_a < std::numeric_limits<T>::min() + val_b)) + else if ((val_b > 0) && (val_a < std::numeric_limits<T>::min() + val_b)) { result = std::numeric_limits<T>::min(); } @@ -115,13 +116,13 @@ T safe_integer_mul(T val_a, T val_b) { T result = 0; - if(val_a > 0) + if (val_a > 0) { - if((val_b > 0) && (val_a > (std::numeric_limits<T>::max() / val_b))) + if ((val_b > 0) && (val_a > (std::numeric_limits<T>::max() / val_b))) { result = std::numeric_limits<T>::max(); } - else if(val_b < (std::numeric_limits<T>::min() / val_a)) + else if (val_b < (std::numeric_limits<T>::min() / val_a)) { result = std::numeric_limits<T>::min(); } @@ -132,11 +133,11 @@ T safe_integer_mul(T val_a, T val_b) } else { - if((val_b > 0) && (val_a < (std::numeric_limits<T>::min() / val_b))) + if ((val_b > 0) && (val_a < (std::numeric_limits<T>::min() / val_b))) { result = std::numeric_limits<T>::max(); } - else if((val_a != 0) && (val_b < (std::numeric_limits<T>::max() / val_a))) + else if ((val_a != 0) && (val_b < (std::numeric_limits<T>::max() / val_a))) { result = std::numeric_limits<T>::min(); } @@ -165,7 +166,7 @@ T safe_integer_div(T val_a, T val_b) { T result = 0; - if((val_b == 0) || ((val_a == std::numeric_limits<T>::min()) && (val_b == -1))) + if ((val_b == 0) || ((val_a == std::numeric_limits<T>::min()) && (val_b == -1))) { result = std::numeric_limits<T>::min(); } @@ -176,7 +177,7 @@ T safe_integer_div(T val_a, T val_b) return result; } -} // namespace cast +} // namespace math } // namespace utils } // namespace arm_compute #endif /* ARM_COMPUTE_UTILS_MATH_SAFE_OPS */ |