Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marc Chevrier
CMake
Commits
e57c4116
Commit
e57c4116
authored
Apr 26, 2021
by
Brad King
Browse files
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream * upstream-KWSys: KWSys 2021-04-26 (642ddfcc)
parents
9d4a0f12
1ba07ff0
Changes
1
Show whitespace changes
Inline
Side-by-side
Source/kwsys/SystemInformation.cxx
View file @
e57c4116
...
@@ -3472,6 +3472,10 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
...
@@ -3472,6 +3472,10 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
// We want to record the total number of cores in this->NumberOfPhysicalCPU
// We want to record the total number of cores in this->NumberOfPhysicalCPU
// (checking only the first proc)
// (checking only the first proc)
std
::
string
Cores
=
this
->
ExtractValueFromCpuInfoFile
(
buffer
,
"cpu cores"
);
std
::
string
Cores
=
this
->
ExtractValueFromCpuInfoFile
(
buffer
,
"cpu cores"
);
if
(
Cores
.
empty
())
{
// Linux Sparc is different
Cores
=
this
->
ExtractValueFromCpuInfoFile
(
buffer
,
"ncpus probed"
);
}
auto
NumberOfCoresPerSocket
=
(
unsigned
int
)
atoi
(
Cores
.
c_str
());
auto
NumberOfCoresPerSocket
=
(
unsigned
int
)
atoi
(
Cores
.
c_str
());
NumberOfCoresPerSocket
=
std
::
max
(
NumberOfCoresPerSocket
,
1u
);
NumberOfCoresPerSocket
=
std
::
max
(
NumberOfCoresPerSocket
,
1u
);
this
->
NumberOfPhysicalCPU
=
this
->
NumberOfPhysicalCPU
=
...
@@ -3490,6 +3494,9 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
...
@@ -3490,6 +3494,9 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
if
(
this
->
NumberOfPhysicalCPU
<=
0
)
{
if
(
this
->
NumberOfPhysicalCPU
<=
0
)
{
this
->
NumberOfPhysicalCPU
=
1
;
this
->
NumberOfPhysicalCPU
=
1
;
}
}
if
(
this
->
NumberOfLogicalCPU
==
0
)
{
this
->
NumberOfLogicalCPU
=
this
->
NumberOfPhysicalCPU
;
}
// LogicalProcessorsPerPhysical>1 => SMT.
// LogicalProcessorsPerPhysical>1 => SMT.
this
->
Features
.
ExtendedFeatures
.
LogicalProcessorsPerPhysical
=
this
->
Features
.
ExtendedFeatures
.
LogicalProcessorsPerPhysical
=
this
->
NumberOfLogicalCPU
/
this
->
NumberOfPhysicalCPU
;
this
->
NumberOfLogicalCPU
/
this
->
NumberOfPhysicalCPU
;
...
@@ -3503,8 +3510,18 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
...
@@ -3503,8 +3510,18 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile()
else
{
else
{
// Linux Sparc: CPU speed is in Hz and encoded in hexadecimal
// Linux Sparc: CPU speed is in Hz and encoded in hexadecimal
CPUSpeed
=
this
->
ExtractValueFromCpuInfoFile
(
buffer
,
"Cpu0ClkTck"
);
CPUSpeed
=
this
->
ExtractValueFromCpuInfoFile
(
buffer
,
"Cpu0ClkTck"
);
if
(
!
CPUSpeed
.
empty
())
{
this
->
CPUSpeedInMHz
=
this
->
CPUSpeedInMHz
=
static_cast
<
float
>
(
strtoull
(
CPUSpeed
.
c_str
(),
nullptr
,
16
))
/
1000000.0
f
;
static_cast
<
float
>
(
strtoull
(
CPUSpeed
.
c_str
(),
nullptr
,
16
))
/
1000000.0
f
;
}
else
{
// if the kernel is build as Sparc32 it's in decimal, note the different
// case
CPUSpeed
=
this
->
ExtractValueFromCpuInfoFile
(
buffer
,
"CPU0ClkTck"
);
this
->
CPUSpeedInMHz
=
static_cast
<
float
>
(
strtoull
(
CPUSpeed
.
c_str
(),
nullptr
,
10
))
/
1000000.0
f
;
}
}
}
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment