KWSys SystemInformation GetNumberOfPhysicalCPU returns 0 on many Windows computers
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
KWSys SystemInformation GetNumberOfPhysicalCPU returns 0 on many computers, for example: https://open.cdash.org/testDetails.php?test=299955070&build=3609236
I've checked the code in KWSys that computes the number of logical and physical CPUs. It is based on a code example released by Intel in 2002 (http://gcc.gnu.org/ml/gcc-help/2002-07/msg00239/Cpucount.cpp) and uses such low-level API that is manufacturer-dependent and has to be updated and tested for each new processor family in every few years. Fixing this and maintaining for all existing CPU is an enormous task, probably is not worth the effort.
On other operating systems KWSys retrieves number of CPUs using higher-level APIs of the operating system. The same could be done for Windows. Probably the GetLogicalProcessorInformation function would be suitable (http://msdn.microsoft.com/en-us/library/ms683194).
See discussion about the problem here: http://review.source.kitware.com/#/c/18388/