[PATCH] D25564: Add interface to compute number of physical cores on host system

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 13:43:23 PDT 2016


kparzysz added a comment.

In https://reviews.llvm.org/D25564#569547, @mehdi_amini wrote:

> I'm not sure how to solve it differently than delegating such logic to the client of this API, i.e. I see this API is a basic-block to build other APIs. 
>  This other API could be for instance `llvm::thread::hardware_coarse_concurrency()`. This is where I would handle handle architecture specific choices (and default to `hardware_concurrency`).


The host will most often be x86, so this isn't really that much of a big deal.  It just seemed like a cleaner idea would be to query the OS about how many concurrent tasks it could handle at the moment, and that could transparently take into account the current load on the machine, if someone wanted to go that far.


Repository:
  rL LLVM

https://reviews.llvm.org/D25564





More information about the llvm-commits mailing list