Skip to content

Commit 6f759a9

Browse files
authored
Merge pull request #4002 from imzhuhl/spr_detect
Fix x86 detection error
2 parents 58de28f + ac65022 commit 6f759a9

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

cpuid_x86.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,7 +1936,8 @@ static char *corename[] = {
19361936
"ZEN",
19371937
"SKYLAKEX",
19381938
"DHYANA",
1939-
"COOPERLAKE"
1939+
"COOPERLAKE",
1940+
"SAPPHIRERAPIDS",
19401941
};
19411942

19421943
static char *corename_lower[] = {
@@ -1970,7 +1971,8 @@ static char *corename_lower[] = {
19701971
"zen",
19711972
"skylakex",
19721973
"dhyana",
1973-
"cooperlake"
1974+
"cooperlake",
1975+
"sapphirerapids",
19741976
};
19751977

19761978

@@ -2276,16 +2278,18 @@ int get_coretype(void){
22762278
return CORE_NEHALEM;
22772279
}
22782280
if (model == 15) { // Sapphire Rapids
2281+
if(support_amx_bf16())
2282+
return CORE_SAPPHIRERAPIDS;
22792283
if(support_avx512_bf16())
2280-
return CPUTYPE_COOPERLAKE;
2284+
return CORE_COOPERLAKE;
22812285
if(support_avx512())
2282-
return CPUTYPE_SKYLAKEX;
2286+
return CORE_SKYLAKEX;
22832287
if(support_avx2())
2284-
return CPUTYPE_HASWELL;
2288+
return CORE_HASWELL;
22852289
if(support_avx())
2286-
return CPUTYPE_SANDYBRIDGE;
2290+
return CORE_SANDYBRIDGE;
22872291
else
2288-
return CPUTYPE_NEHALEM;
2292+
return CORE_NEHALEM;
22892293
}
22902294
break;
22912295

0 commit comments

Comments
 (0)