From 376c85f3d826526b8b197c55e22c10765a97631e Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Fri, 25 May 2018 14:17:21 +0100 Subject: COMPMID-1180: Add support for bucket multi-threading (Part2) - Introduced some Hints allowing the function to set its favourite splitting method for a given workload - Implemented the bucket split (Disabled by default) Change-Id: I3a48dfb0bd0ec8b69a44d9c4a4c77ad3f6dc9827 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/133079 Tested-by: Jenkins Reviewed-by: Gian Marco Iodice --- src/runtime/OMP/OMPScheduler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/runtime/OMP/OMPScheduler.cpp') diff --git a/src/runtime/OMP/OMPScheduler.cpp b/src/runtime/OMP/OMPScheduler.cpp index 795c96caf0..43a8a6de54 100644 --- a/src/runtime/OMP/OMPScheduler.cpp +++ b/src/runtime/OMP/OMPScheduler.cpp @@ -56,7 +56,7 @@ void OMPScheduler::set_num_threads(unsigned int num_threads) _num_threads = (num_threads == 0) ? num_cores : num_threads; } -void OMPScheduler::schedule(ICPPKernel *kernel, unsigned int split_dimension) +void OMPScheduler::schedule(ICPPKernel *kernel, const Hints &hints) { ARM_COMPUTE_ERROR_ON_MSG(!kernel, "The child class didn't set the kernel"); @@ -64,7 +64,7 @@ void OMPScheduler::schedule(ICPPKernel *kernel, unsigned int split_dimension) info.cpu_info = &_cpu_info; const Window &max_window = kernel->window(); - const unsigned int num_iterations = max_window.num_iterations(split_dimension); + const unsigned int num_iterations = max_window.num_iterations(hints.split_dimension()); info.num_threads = std::min(num_iterations, _num_threads); if(!kernel->is_parallelisable() || info.num_threads == 1) @@ -76,7 +76,7 @@ void OMPScheduler::schedule(ICPPKernel *kernel, unsigned int split_dimension) #pragma omp parallel firstprivate(info) num_threads(info.num_threads) { const int tid = omp_get_thread_num(); - Window win = max_window.split_window(split_dimension, tid, info.num_threads); + Window win = max_window.split_window(hints.split_dimension(), tid, info.num_threads); info.thread_id = tid; kernel->run(win, info); } -- cgit v1.2.1