diff options
author | Omar Al Khatib <omar.alkhatib@arm.com> | 2024-05-21 15:07:09 +0100 |
---|---|---|
committer | Pablo Marquez Tello <pablo.tello@arm.com> | 2024-05-21 16:15:59 +0000 |
commit | 1d2733e35deb9ddbdde5521b1f5b0511085a3702 (patch) | |
tree | 98e1abf3e615f04e9de3e7c3864eb014d89a8e8c /src/runtime | |
parent | f5053f782daa942126bd61ac1bcfc0af627b7b31 (diff) | |
download | ComputeLibrary-1d2733e35deb9ddbdde5521b1f5b0511085a3702.tar.gz |
Fix issues with OpenMP scheduler little core exclusion.
1. Remove unnecessary restriction to the exclusion only running on systems with little mid and big cores.
2. Allow override of the suggested number of threads in case the user sets the number of threads to a lower value.
Resolves [COMPMID-7014]
Signed-off-by: Omar Al Khatib <omar.alkhatib@arm.com>
Change-Id: Ifb76ef4454f38dd2e3e5781b5dfea07c044aeb74
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/11604
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Marquez Tello <pablo.tello@arm.com>
Diffstat (limited to 'src/runtime')
-rw-r--r-- | src/runtime/OMP/OMPScheduler.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/runtime/OMP/OMPScheduler.cpp b/src/runtime/OMP/OMPScheduler.cpp index 2a5abb5f7a..aba5ff2902 100644 --- a/src/runtime/OMP/OMPScheduler.cpp +++ b/src/runtime/OMP/OMPScheduler.cpp @@ -36,16 +36,13 @@ namespace arm_compute (defined(__arm__) || defined(__aarch64__)) && defined(__ANDROID__) OMPScheduler::OMPScheduler() // NOLINT : _num_threads(cpu_info().get_cpu_num_excluding_little()), - _has_lmb(cpu_info().cpu_has_little_mid_big()), _nonlittle_num_cpus(cpu_info().get_cpu_num_excluding_little()) { } #else /* !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && \ (defined(__arm__) || defined(__aarch64__)) && defined(__ANDROID__)*/ OMPScheduler::OMPScheduler() // NOLINT - : _num_threads(omp_get_max_threads()), - _has_lmb(cpu_info().cpu_has_little_mid_big()), - _nonlittle_num_cpus(cpu_info().get_cpu_num_excluding_little()) + : _num_threads(omp_get_max_threads()), _nonlittle_num_cpus(cpu_info().get_cpu_num_excluding_little()) { } #endif /* !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && \ @@ -61,7 +58,7 @@ void OMPScheduler::set_num_threads(unsigned int num_threads) const unsigned int num_cores = omp_get_max_threads(); #if !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && \ (defined(__arm__) || defined(__aarch64__)) && defined(__ANDROID__) - const unsigned int adjusted_num_threads = (_has_lmb) ? _nonlittle_num_cpus : num_threads; + const unsigned int adjusted_num_threads = std::min(_nonlittle_num_cpus, num_threads); _num_threads = (num_threads == 0) ? num_cores : adjusted_num_threads; #else /* !defined(_WIN64) && !defined(BARE_METAL) && !defined(__APPLE__) && !defined(__OpenBSD__) && \ (defined(__arm__) || defined(__aarch64__)) && defined(__ANDROID__)*/ |