Merge pull request #4303 from martin-frbg/ryzen-avx512

Enable autodetection of Zen 3/4 cpus as their AVX512 Intel counterparts
This commit is contained in:
Martin Kroeker 2023-11-11 18:36:24 +01:00 committed by GitHub
commit cad10a3caa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -1660,7 +1660,13 @@ int get_cpuname(void){
else else
return CPUTYPE_BARCELONA; 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()) if(support_avx())
#ifndef NO_AVX2 #ifndef NO_AVX2
return CPUTYPE_ZEN; return CPUTYPE_ZEN;
@ -2438,6 +2444,12 @@ int get_coretype(void){
// Ryzen 2 // Ryzen 2
default: default:
// Matisse,Renoir Ryzen2 models // Matisse,Renoir Ryzen2 models
#ifndef NO_AVX512
if(support_avx512_bf16())
return CORE_COOPERLAKE;
if(support_avx512())
return CORE_SKYLAKEX;
#endif
if(support_avx()) if(support_avx())
#ifndef NO_AVX2 #ifndef NO_AVX2
return CORE_ZEN; return CORE_ZEN;