ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

How can I set the number of threads ?

Open Weyne168 opened this issue 9 years ago • 3 comments

Hi, I found that the library will use all cores on default. in some cases, I need to run it with given number of threads. how can I set the number?

Weyne168 avatar May 05 '17 03:05 Weyne168

Hi,

You can call arm_compute::Scheduler::get().set_num_threads(num_threads); at the beginning of your program.

AnthonyBarbier avatar May 05 '17 08:05 AnthonyBarbier

Hi, I found you should put "NEScheduler::get().force_number_of_threads(num_threads);" at the beginning of your program. In addition, "NEScheduler.h" should be also include in the header files.

duhuanxianzi avatar May 05 '17 10:05 duhuanxianzi

CPPScheduler::force_number_of_threads() can be used to manually set the number of threads

samsun639 avatar May 25 '17 09:05 samsun639