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

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 10:35:34 PDT 2016


On Thu, Oct 13, 2016 at 1:30 PM, Mehdi AMINI <mehdi.amini at apple.com> wrote:
> mehdi_amini added inline comments.
>
>
> ================
> Comment at: lib/Support/Host.cpp:1239
> +// On other systems, return -1 to indicate unknown.
> +int computeHostNumPhysicalCores() { return -1; }
> +#endif
> ----------------
> aaron.ballman wrote:
>> No Windows implementation? Should be able to use `GetLogicalProcessorInformation()` pretty easily.
>>
>> https://msdn.microsoft.com/en-us/library/windows/desktop/ms683194(v=vs.85).aspx
> Patch welcome :)

Happy to work on a patch, but I worry when we add new interfaces that
don't work across platforms unless they bark loudly. An assert() here
might not be amiss.

~Aaron

>
> I'll supply the MacOS version when possible.
>
>
> https://reviews.llvm.org/D25564
>
>
>


More information about the llvm-commits mailing list