Skip to content

Commit f44c597

Browse files
committed
GPU (macOS): apply the same logic as CPU just in case
1 parent 644458b commit f44c597

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/detection/cpu/cpu_apple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static const char* detectFrequency(FFCPUResult* cpu)
6060

6161
if (pMax > 0)
6262
{
63-
if (pMax > 100000000) // Assume that pMax is in MHz, M1~M3
63+
if (pMax > 100000000) // Assume that pMax is in Hz, M1~M3
6464
cpu->frequencyMax = pMax / 1000 / 1000;
6565
else // Assume that pMax is in kHz, M4 and later (#1394)
6666
cpu->frequencyMax = pMax / 1000;

src/detection/gpu/gpu_apple.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ static const char* detectFrequency(FFGPUResult* gpu)
6868
pMax = pMax > pStart[i] ? pMax : pStart[i];
6969

7070
if (pMax > 0)
71-
gpu->frequency = pMax / 1000 / 1000;
71+
{
72+
// While this is not necessary for now (seems), we add this logic just in case. See cpu_apple.c
73+
if (pMax > 100000000) // Assume that pMax is in Hz
74+
cpu->frequencyMax = pMax / 1000 / 1000;
75+
else // Assume that pMax is in kHz
76+
cpu->frequencyMax = pMax / 1000;
77+
}
7278

7379
return NULL;
7480
}

0 commit comments

Comments
 (0)