mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-12 23:43:59 +03:00
KWSys 2025-01-22 (22ffdf26)
Code extracted from:
https://gitlab.kitware.com/utils/kwsys.git
at commit 22ffdf26989e08367b722087a7f126ce23eb8e2f (master).
Upstream Shortlog
-----------------
Tom Stellard (1):
e1aeb61e SystemInformation: Fix GetNumberOfLogicalCPU on s390x
This commit is contained in:
1 parent
5224aabf05
commit
d6d1695d89
1 file changed
+8
-2
@@ -3418,10 +3418,16 @@ bool SystemInformationImplementation::RetrieveInformationFromCpuInfoFile()
|
||||
buffer.resize(fileSize - 2);
|
||||
// Number of logical CPUs (combination of multiple processors, multi-core
|
||||
// and SMT)
|
||||
size_t pos = buffer.find("processor\t");
|
||||
const char* processor_string =
|
||||
#ifdef __s390x__
|
||||
"cpu number";
|
||||
#else
|
||||
"processor\t";
|
||||
#endif
|
||||
size_t pos = buffer.find(processor_string);
|
||||
while (pos != std::string::npos) {
|
||||
this->NumberOfLogicalCPU++;
|
||||
pos = buffer.find("processor\t", pos + 1);
|
||||
pos = buffer.find(processor_string, pos + 1);
|
||||
}
|
||||
|
||||
#if defined(__linux) || defined(__CYGWIN__)
|
||||
|
||||
Reference in new issue
Block a user