From 778e3b746a7217bbafa099133f956753e8355c4b Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Fri, 10 Nov 2023 11:55:29 +0100 Subject: [PATCH] Enable autodetection of current AMD cpus as their AVX512 Intel counterparts --- cpuid_x86.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cpuid_x86.c b/cpuid_x86.c index fdcead8bd..6cf4d6503 100644 --- a/cpuid_x86.c +++ b/cpuid_x86.c @@ -1660,7 +1660,13 @@ int get_cpuname(void){ else return CPUTYPE_BARCELONA; } - case 10: // Zen3 + case 10: // Zen3/4 +#ifndef NO_AVX512 + if(support_avx512_bf16()) + return CPUTYPE_COOPERLAKE; + if(support_avx512()) + return CPUTYPE_SKYLAKEX; +#endif if(support_avx()) #ifndef NO_AVX2 return CPUTYPE_ZEN; @@ -2438,6 +2444,12 @@ int get_coretype(void){ // Ryzen 2 default: // Matisse,Renoir Ryzen2 models +#ifndef NO_AVX512 + if(support_avx512_bf16()) + return CORE_COOPERLAKE; + if(support_avx512()) + return CORE_SKYLAKEX; +#endif if(support_avx()) #ifndef NO_AVX2 return CORE_ZEN;