The 16x seems to be wrong.processors : 16x AMD Ryzen 9 3900X 12-Core Processor
Wrong number of logical processors
Wrong number of logical processors
Within of a report we got:
Re: Wrong number of logical processors
Maybe you can debug the code on your side?
Code: Select all
function GetCpuCount : integer;
var i1 : integer;
begin
result := 16;
for i1 := 1 to 15 do
if RegReadStr(HKEY_LOCAL_MACHINE, 'hardware\description\system\centralProcessor\' + IntToStrExW(i1), 'ProcessorNameString') = '' then begin
result := i1;
break;
end;
end;
Re: Wrong number of logical processors
There are values for 0 to 23.
So you shouldn't stop at 15.
Since you check for an empty string a simple inc( i1 ) should also do?
I guess that cpu with more than 8 cores will become more and more common.
So you shouldn't stop at 15.
Since you check for an empty string a simple inc( i1 ) should also do?
I guess that cpu with more than 8 cores will become more and more common.
Re: Wrong number of logical processors
Ah, makes perfect sense, I'll change the code accordingly.
Re: Wrong number of logical processors
New version, should support up to 256 cores:
Code: Select all
function GetCpuCount : integer;
var i1, i2 : integer;
begin
result := 256;
for i1 := 0 to 15 do
if RegReadStr(HKEY_LOCAL_MACHINE, 'hardware\description\system\centralProcessor\' + IntToStrExW(i1 * 16 + 16), 'ProcessorNameString') = '' then begin
result := i1 * 16 + 16;
for i2 := 1 to 15 do
if RegReadStr(HKEY_LOCAL_MACHINE, 'hardware\description\system\centralProcessor\' + IntToStrExW(i1 * 16 + i2), 'ProcessorNameString') = '' then begin
result := i1 * 16 + i2;
break;
end;
break;
end;
end;