Skip to content

Commit 6ed5257

Browse files
authored
Add feature-based fallback for unknown x86_64 cpus
1 parent 126ad48 commit 6ed5257

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

driver/others/dynamic.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,13 @@ void gotoblas_dynamic_init(void) {
10611061
#ifdef ARCH_X86
10621062
if (gotoblas == NULL) gotoblas = &gotoblas_KATMAI;
10631063
#else
1064-
if (gotoblas == NULL) gotoblas = &gotoblas_PRESCOTT;
1064+
if (gotoblas == NULL) {
1065+
if (support_avx512_bf16()) gotoblas = &gotoblas_COOPERLAKE;
1066+
else if (support_avx512()) gotoblas = &gotoblas_SKYLAKEX;
1067+
else if (support_avx2()) gotoblas = &gotoblas_HASWELL;
1068+
else if (support_avx()) gotoblas = &gotoblas_SANDYBRIDGE;
1069+
else gotoblas = &gotoblas_PRESCOTT;
1070+
}
10651071
/* sanity check, if 64bit pointer we can't have a 32 bit cpu */
10661072
if (sizeof(void*) == 8) {
10671073
if (gotoblas == &gotoblas_KATMAI ||

0 commit comments

Comments
 (0)