aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/SchedulerUtils.cpp
diff options
context:
space:
mode:
authorFelix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com>2023-09-27 17:46:17 +0100
committerfelixjohnny.thomasmathibalan <felixjohnny.thomasmathibalan@arm.com>2023-09-28 12:08:05 +0000
commitafd38f0c617d6f89b2b4532c6c44f116617e2b6f (patch)
tree03bc7d5a762099989b16a656fa8d397b490ed70e /src/runtime/SchedulerUtils.cpp
parentbdcb4c148ee2fdeaaddf4cf1e57bbb0de02bb894 (diff)
downloadComputeLibrary-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 'src/runtime/SchedulerUtils.cpp')
-rw-r--r--src/runtime/SchedulerUtils.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/runtime/SchedulerUtils.cpp b/src/runtime/SchedulerUtils.cpp
index 6f9a32c879..74ee539fec 100644
--- a/src/runtime/SchedulerUtils.cpp
+++ b/src/runtime/SchedulerUtils.cpp
@@ -47,35 +47,34 @@ std::pair<unsigned, unsigned> split_2d(unsigned max_threads, std::size_t m, std:
double ratio = m / static_cast<double>(n);
// nt = sqrt(max_threads * (m / n) )
- const unsigned adjusted = std::round(
- std::sqrt(max_threads * ratio));
+ const unsigned adjusted = std::round(std::sqrt(max_threads * ratio));
//find the nearest factor of max_threads
- for(unsigned i = 0; i != adjusted; ++i)
+ for (unsigned i = 0; i != adjusted; ++i)
{
//try down
const unsigned adj_down = adjusted - i;
- if(max_threads % adj_down == 0)
+ if (max_threads % adj_down == 0)
{
- return { adj_down, max_threads / adj_down };
+ return {adj_down, max_threads / adj_down};
}
//try up
const unsigned adj_up = adjusted + i;
- if(max_threads % adj_up == 0)
+ if (max_threads % adj_up == 0)
{
- return { adj_up, max_threads / adj_up };
+ return {adj_up, max_threads / adj_up};
}
}
//we didn't find anything so lets bail out with maxes biased to the largest dimension
- if(m > n)
+ if (m > n)
{
- return { std::min<unsigned>(m, max_threads), 1 };
+ return {std::min<unsigned>(m, max_threads), 1};
}
else
{
- return { 1, std::min<unsigned>(n, max_threads) };
+ return {1, std::min<unsigned>(n, max_threads)};
}
}
#endif /* #ifndef BARE_METAL */