Skip to content

Commit d0f036b

Browse files
airborne12claude
andcommitted
fix: add CPU detection for Intel Emerald Rapids and newer processors
Problem: Intel Xeon Platinum 8575C (Emerald Rapids, model 207 = exmodel 12, model 15) was incorrectly detected as PRESCOTT (Pentium 4 era) instead of SAPPHIRERAPIDS. Root cause: 1. In get_corename() function, case 12 (exmodel 12) only handled model 6 (Arrow Lake) but missed model 15 (Emerald Rapids) 2. Missing break statement caused fall-through to case 15 (family 15, which is Pentium 4), returning CORE_PRESCOTT incorrectly 3. dynamic.c lacked support for exmodel 10-12 newer Intel processors Changes: - cpuid_x86.c: Add case 15 (Emerald Rapids) to exmodel 12 switch and add missing break statement - dynamic.c: Add runtime detection support for: - Exmodel 10: Meteor Lake (model 0, 10), Granite Rapids (model 13) - Exmodel 11: Raptor Lake, Alder Lake N (model 7, 10, 14, 15) - Exmodel 12: Arrow Lake (model 6), Emerald Rapids (model 15) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 77986e4 commit d0f036b

2 files changed

Lines changed: 65 additions & 3 deletions

File tree

cpuid_x86.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,6 +2424,7 @@ int get_coretype(void){
24242424
}
24252425
case 12:
24262426
switch (model) {
2427+
case 15: // Emerald Rapids (e.g., Intel Xeon Platinum 8575C)
24272428
case 6: // Arrow Lake
24282429
if(support_amx_bf16())
24292430
return CORE_SAPPHIRERAPIDS;
@@ -2438,6 +2439,7 @@ int get_coretype(void){
24382439
else
24392440
return CORE_NEHALEM;
24402441
}
2442+
break;
24412443
}
24422444
case 15:
24432445
if (model <= 0x2) return CORE_NORTHWOOD;

driver/others/dynamic.c

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,8 @@ static gotoblas_t *get_coretype(void){
791791
return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
792792
}
793793
}
794-
if (model == 7) {
795-
if (support_avx512())
794+
if (model == 7 || model == 0) { // Rocket Lake, Meteor Lake
795+
if (support_avx512())
796796
return &gotoblas_SKYLAKEX;
797797
if(support_avx2())
798798
return &gotoblas_HASWELL;
@@ -803,7 +803,67 @@ static gotoblas_t *get_coretype(void){
803803
openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
804804
return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels.
805805
}
806-
}
806+
}
807+
if (model == 10) { // Meteor Lake
808+
if(support_avx2())
809+
return &gotoblas_HASWELL;
810+
if(support_avx()) {
811+
openblas_warning(FALLBACK_VERBOSE, SANDYBRIDGE_FALLBACK);
812+
return &gotoblas_SANDYBRIDGE;
813+
} else {
814+
openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
815+
return &gotoblas_NEHALEM;
816+
}
817+
}
818+
if (model == 13) { // Granite Rapids
819+
if(support_amx_bf16())
820+
return &gotoblas_SAPPHIRERAPIDS;
821+
if(support_avx512_bf16())
822+
return &gotoblas_COOPERLAKE;
823+
if (support_avx512())
824+
return &gotoblas_SKYLAKEX;
825+
if(support_avx2())
826+
return &gotoblas_HASWELL;
827+
if(support_avx()) {
828+
openblas_warning(FALLBACK_VERBOSE, SANDYBRIDGE_FALLBACK);
829+
return &gotoblas_SANDYBRIDGE;
830+
} else {
831+
openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
832+
return &gotoblas_NEHALEM;
833+
}
834+
}
835+
return NULL;
836+
case 11:
837+
if (model == 7 || model == 10 || model == 14 || model == 15) { // Raptor Lake, Alder Lake N
838+
if(support_avx2())
839+
return &gotoblas_HASWELL;
840+
if(support_avx()) {
841+
openblas_warning(FALLBACK_VERBOSE, SANDYBRIDGE_FALLBACK);
842+
return &gotoblas_SANDYBRIDGE;
843+
} else {
844+
openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
845+
return &gotoblas_NEHALEM;
846+
}
847+
}
848+
return NULL;
849+
case 12:
850+
if (model == 6 || model == 15) { // Arrow Lake, Emerald Rapids (e.g., Intel Xeon Platinum 8575C)
851+
if(support_amx_bf16())
852+
return &gotoblas_SAPPHIRERAPIDS;
853+
if(support_avx512_bf16())
854+
return &gotoblas_COOPERLAKE;
855+
if (support_avx512())
856+
return &gotoblas_SKYLAKEX;
857+
if(support_avx2())
858+
return &gotoblas_HASWELL;
859+
if(support_avx()) {
860+
openblas_warning(FALLBACK_VERBOSE, SANDYBRIDGE_FALLBACK);
861+
return &gotoblas_SANDYBRIDGE;
862+
} else {
863+
openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
864+
return &gotoblas_NEHALEM;
865+
}
866+
}
807867
return NULL;
808868
}
809869
break;

0 commit comments

Comments
 (0)