From 7fad9b1d00f3ee1488ba4038d1371f6ea219f8b7 Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Wed, 14 Mar 2018 17:55:27 +0000 Subject: COMPMID-1021: CPUInfo refactoring. Removed CPUTarget in favor of the CPUModel type. CPUInfo now holds a vector of N CPUs. CPUInfo autoinitialise upon construction with 1 GENERIC CPU. CPPScheduler fills CPUInfo's vector upon construction (runtime). IScheduler has a single CPUInfo obj and ThreadInfo always gets a pointer to it (avoid copying the vector) Change-Id: I30f293258c959c87f6bac5eac8b963beb6a4d365 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/124626 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- src/runtime/OMP/OMPScheduler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/runtime/OMP/OMPScheduler.cpp') diff --git a/src/runtime/OMP/OMPScheduler.cpp b/src/runtime/OMP/OMPScheduler.cpp index 3b30f1e56b..795c96caf0 100644 --- a/src/runtime/OMP/OMPScheduler.cpp +++ b/src/runtime/OMP/OMPScheduler.cpp @@ -27,6 +27,7 @@ #include "arm_compute/core/Error.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Utils.h" +#include "arm_compute/runtime/CPUUtils.h" #include @@ -41,6 +42,7 @@ OMPScheduler &OMPScheduler::get() OMPScheduler::OMPScheduler() // NOLINT : _num_threads(omp_get_max_threads()) { + get_cpu_configuration(_cpu_info); } unsigned int OMPScheduler::num_threads() const @@ -59,7 +61,7 @@ void OMPScheduler::schedule(ICPPKernel *kernel, unsigned int split_dimension) ARM_COMPUTE_ERROR_ON_MSG(!kernel, "The child class didn't set the kernel"); ThreadInfo info; - info.cpu_info = _info; + info.cpu_info = &_cpu_info; const Window &max_window = kernel->window(); const unsigned int num_iterations = max_window.num_iterations(split_dimension); @@ -71,7 +73,7 @@ void OMPScheduler::schedule(ICPPKernel *kernel, unsigned int split_dimension) } else { - #pragma omp parallel private(info) num_threads(info.num_threads) + #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); -- cgit v1.2.1