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/Dimensions.h | |
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/Dimensions.h')
-rw-r--r-- | arm_compute/core/Dimensions.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/arm_compute/core/Dimensions.h b/arm_compute/core/Dimensions.h index 2ebfcd7f83..bb8692d70a 100644 --- a/arm_compute/core/Dimensions.h +++ b/arm_compute/core/Dimensions.h @@ -50,8 +50,7 @@ public: * @param[in] dims Values to initialize the dimensions. */ template <typename... Ts> - explicit Dimensions(Ts... dims) - : _id{ { static_cast<T>(dims)... } }, _num_dimensions{ sizeof...(dims) } + explicit Dimensions(Ts... dims) : _id{{static_cast<T>(dims)...}}, _num_dimensions{sizeof...(dims)} { } @@ -78,7 +77,7 @@ public: ARM_COMPUTE_ERROR_ON(dimension >= num_max_dimensions); _id[dimension] = value; // Don't increase the number of dimensions if the new dimension is 1 - if(increase_dim_unit || value != 1) + if (increase_dim_unit || value != 1) { _num_dimensions = std::max(_num_dimensions, dimension + 1); } @@ -108,7 +107,7 @@ public: void increment(size_t dim, T step = 1) { ARM_COMPUTE_ERROR_ON(dim >= _num_dimensions); - if((std::numeric_limits<T>::max() - _id[dim]) >= step) + if ((std::numeric_limits<T>::max() - _id[dim]) >= step) { _id[dim] += step; } @@ -162,7 +161,7 @@ public: const size_t last = std::min(_num_dimensions, first + n); - if(last > (first + 1)) + if (last > (first + 1)) { // Collapse dimensions into the first _id[first] = std::accumulate(&_id[first], &_id[last], 1, std::multiplies<T>()); @@ -196,7 +195,7 @@ public: void remove(size_t idx) { ARM_COMPUTE_ERROR_ON(_num_dimensions < 1); - if(idx >= _num_dimensions) + if (idx >= _num_dimensions) { return; } @@ -262,7 +261,7 @@ protected: ~Dimensions() = default; std::array<T, num_max_dimensions> _id; - size_t _num_dimensions{ 0 }; + size_t _num_dimensions{0}; }; /** Check that given dimensions are equal. @@ -289,5 +288,5 @@ inline bool operator!=(const Dimensions<T> &lhs, const Dimensions<T> &rhs) { return !(lhs == rhs); } -} +} // namespace arm_compute #endif /*ARM_COMPUTE_DIMENSIONS_H*/ |