From 53d12277563f860852532ace2a6c796384d969dd Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 1 Feb 2018 20:23:25 +0000 Subject: COMPMID-874: Improve default number of threads choice in the Scheduler Change-Id: Ia30ec2afce0aafcd39f41440efb972b18bbda9f8 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/118657 Reviewed-by: Anthony Barbier Tested-by: Jenkins Reviewed-by: Pablo Tello --- arm_compute/runtime/IScheduler.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'arm_compute/runtime/IScheduler.h') diff --git a/arm_compute/runtime/IScheduler.h b/arm_compute/runtime/IScheduler.h index 8918843c98..1dd7c2cfb2 100644 --- a/arm_compute/runtime/IScheduler.h +++ b/arm_compute/runtime/IScheduler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -70,9 +70,20 @@ public: * @return CPU info. */ CPUInfo cpu_info() const; + /** Get a hint for the best possible number of execution threads + * + * @warning In case we can't work out the best number of threads, + * std::thread::hardware_concurrency() is returned else 1 in case of bare metal builds + * + * @return Best possible number of execution threads to use + */ + unsigned int num_threads_hint() const; protected: CPUInfo _info{}; + +private: + unsigned int _num_threads_hint = {}; }; } #endif /* __ARM_COMPUTE_ISCHEDULER_H__ */ -- cgit v1.2.1