From cc7cab8a45d031e7e0e78147a863a632d584ed9d Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Wed, 9 Sep 2015 10:47:17 -0500 Subject: [PATCH] Detect other Intel Skylake cores. http://users.atw.hu/instlatx64/ --- cpuid_x86.c | 22 ++++++++++++++++++++++ driver/others/dynamic.c | 11 ++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/cpuid_x86.c b/cpuid_x86.c index 828ecc328..135ac7cf9 100644 --- a/cpuid_x86.c +++ b/cpuid_x86.c @@ -1133,6 +1133,16 @@ int get_cpuname(void){ return CPUTYPE_HASWELL; #else return CPUTYPE_SANDYBRIDGE; +#endif + else + return CPUTYPE_NEHALEM; + case 14: + //Skylake + if(support_avx()) +#ifndef NO_AVX2 + return CPUTYPE_HASWELL; +#else + return CPUTYPE_SANDYBRIDGE; #endif else return CPUTYPE_NEHALEM; @@ -1150,6 +1160,7 @@ int get_cpuname(void){ #endif else return CPUTYPE_NEHALEM; + case 5: case 14: // Skylake if(support_avx()) @@ -1618,6 +1629,16 @@ int get_coretype(void){ return CORE_HASWELL; #else return CORE_SANDYBRIDGE; +#endif + else + return CORE_NEHALEM; + case 14: + //Skylake + if(support_avx()) +#ifndef NO_AVX2 + return CORE_HASWELL; +#else + return CORE_SANDYBRIDGE; #endif else return CORE_NEHALEM; @@ -1635,6 +1656,7 @@ int get_coretype(void){ #endif else return CORE_NEHALEM; + case 5: case 14: // Skylake if(support_avx()) diff --git a/driver/others/dynamic.c b/driver/others/dynamic.c index 1f70b798c..c41164559 100644 --- a/driver/others/dynamic.c +++ b/driver/others/dynamic.c @@ -252,6 +252,15 @@ static gotoblas_t *get_coretype(void){ return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels. } } + //Intel Skylake + if (model == 14) { + if(support_avx()) + return &gotoblas_HASWELL; + else{ + openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK); + return &gotoblas_NEHALEM; //OS doesn't support AVX. Use old kernels. + } + } return NULL; case 5: //Intel Broadwell @@ -264,7 +273,7 @@ static gotoblas_t *get_coretype(void){ } } //Intel Skylake - if (model == 14) { + if (model == 14 || model == 5) { if(support_avx()) return &gotoblas_HASWELL; else{