From 6ed52576f8d68d1476329160ed32cc0ff46ec751 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 16 Dec 2021 22:02:49 +0100 Subject: [PATCH] Add feature-based fallback for unknown x86_64 cpus --- driver/others/dynamic.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/driver/others/dynamic.c b/driver/others/dynamic.c index 653915a..b12fb06 100644 --- a/driver/others/dynamic.c +++ b/driver/others/dynamic.c @@ -1061,7 +1061,13 @@ void gotoblas_dynamic_init(void) { #ifdef ARCH_X86 if (gotoblas == NULL) gotoblas = &gotoblas_KATMAI; #else - if (gotoblas == NULL) gotoblas = &gotoblas_PRESCOTT; + if (gotoblas == NULL) { + if (support_avx512_bf16()) gotoblas = &gotoblas_COOPERLAKE; + else if (support_avx512()) gotoblas = &gotoblas_SKYLAKEX; + else if (support_avx2()) gotoblas = &gotoblas_HASWELL; + else if (support_avx()) gotoblas = &gotoblas_SANDYBRIDGE; + else gotoblas = &gotoblas_PRESCOTT; + } /* sanity check, if 64bit pointer we can't have a 32 bit cpu */ if (sizeof(void*) == 8) { if (gotoblas == &gotoblas_KATMAI || -- 2.7.4