Skip to content

Commit 86a5f98

Browse files
authored
Merge pull request #13 from xianyi/develop
rebase
2 parents 8189a98 + 1caa44b commit 86a5f98

File tree

12 files changed

+67
-25
lines changed

12 files changed

+67
-25
lines changed

cmake/lapacke.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2499,6 +2499,5 @@ foreach (Utils_FILE ${Utils_SRC})
24992499
endforeach ()
25002500

25012501
set(lapacke_include_dir "${NETLIB_LAPACK_DIR}/LAPACKE/include")
2502-
configure_file("${lapacke_include_dir}/lapacke_mangling_with_flags.h.in" "${lapacke_include_dir}/lapacke_mangling.h" COPYONLY)
25032502
include_directories(${lapacke_include_dir})
25042503
set_source_files_properties(${LAPACKE_SOURCES} PROPERTIES COMPILE_FLAGS "${LAPACK_CFLAGS}")

cpuid_x86.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,15 @@ int get_cpuname(void){
14181418
case 9:
14191419
case 8:
14201420
switch (model) {
1421+
case 12: // Tiger Lake
1422+
if(support_avx512())
1423+
return CPUTYPE_SKYLAKEX;
1424+
if(support_avx2())
1425+
return CPUTYPE_HASWELL;
1426+
if(support_avx())
1427+
return CPUTYPE_SANDYBRIDGE;
1428+
else
1429+
return CPUTYPE_NEHALEM;
14211430
case 14: // Kaby Lake and refreshes
14221431
if(support_avx2())
14231432
return CPUTYPE_HASWELL;
@@ -2124,6 +2133,16 @@ int get_coretype(void){
21242133
break;
21252134
case 9:
21262135
case 8:
2136+
if (model == 12) { // Tiger Lake
2137+
if(support_avx512())
2138+
return CPUTYPE_SKYLAKEX;
2139+
if(support_avx2())
2140+
return CPUTYPE_HASWELL;
2141+
if(support_avx())
2142+
return CPUTYPE_SANDYBRIDGE;
2143+
else
2144+
return CPUTYPE_NEHALEM;
2145+
}
21272146
if (model == 14) { // Kaby Lake
21282147
if(support_avx())
21292148
#ifndef NO_AVX2

driver/others/blas_server.c

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,38 +1024,39 @@ int BLASFUNC(blas_thread_shutdown)(void){
10241024

10251025
int i;
10261026

1027-
if (!blas_server_avail) return 0;
1028-
10291027
LOCK_COMMAND(&server_lock);
10301028

1031-
for (i = 0; i < blas_num_threads - 1; i++) {
1029+
if (blas_server_avail) {
10321030

1031+
for (i = 0; i < blas_num_threads - 1; i++) {
10331032

1034-
pthread_mutex_lock (&thread_status[i].lock);
10351033

1036-
atomic_store_queue(&thread_status[i].queue, (blas_queue_t *)-1);
1037-
thread_status[i].status = THREAD_STATUS_WAKEUP;
1038-
pthread_cond_signal (&thread_status[i].wakeup);
1034+
pthread_mutex_lock (&thread_status[i].lock);
10391035

1040-
pthread_mutex_unlock(&thread_status[i].lock);
1036+
atomic_store_queue(&thread_status[i].queue, (blas_queue_t *)-1);
1037+
thread_status[i].status = THREAD_STATUS_WAKEUP;
1038+
pthread_cond_signal (&thread_status[i].wakeup);
10411039

1042-
}
1040+
pthread_mutex_unlock(&thread_status[i].lock);
10431041

1044-
for(i = 0; i < blas_num_threads - 1; i++){
1045-
pthread_join(blas_threads[i], NULL);
1046-
}
1042+
}
10471043

1048-
for(i = 0; i < blas_num_threads - 1; i++){
1049-
pthread_mutex_destroy(&thread_status[i].lock);
1050-
pthread_cond_destroy (&thread_status[i].wakeup);
1051-
}
1044+
for(i = 0; i < blas_num_threads - 1; i++){
1045+
pthread_join(blas_threads[i], NULL);
1046+
}
1047+
1048+
for(i = 0; i < blas_num_threads - 1; i++){
1049+
pthread_mutex_destroy(&thread_status[i].lock);
1050+
pthread_cond_destroy (&thread_status[i].wakeup);
1051+
}
10521052

10531053
#ifdef NEED_STACKATTR
1054-
pthread_attr_destory(&attr);
1054+
pthread_attr_destroy(&attr);
10551055
#endif
10561056

1057-
blas_server_avail = 0;
1057+
blas_server_avail = 0;
10581058

1059+
}
10591060
UNLOCK_COMMAND(&server_lock);
10601061

10611062
return 0;

driver/others/dynamic.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,21 @@ static gotoblas_t *get_coretype(void){
644644
return NULL;
645645
case 9:
646646
case 8:
647+
if (model == 12) { // Tiger Lake
648+
if (support_avx512())
649+
return &gotoblas_SKYLAKEX;
650+
if(support_avx2()){
651+
openblas_warning(FALLBACK_VERBOSE, HASWELL_FALLBACK);
652+
return &gotoblas_HASWELL;
653+
}
654+
if(support_avx()) {
655+
openblas_warning(FALLBACK_VERBOSE, SANDYBRIDGE_FALLBACK);
656+
return &gotoblas_SANDYBRIDGE;
657+
} else {
658+
openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
659+
return &gotoblas_NEHALEM;
660+
}
661+
}
647662
if (model == 14 ) { // Kaby Lake, Coffee Lake
648663
if(support_avx2())
649664
return &gotoblas_HASWELL;

driver/others/memory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,11 @@ int get_num_procs(void);
222222
#else
223223
int get_num_procs(void) {
224224
static int nums = 0;
225+
226+
#if defined(__GLIBC_PREREQ)
225227
cpu_set_t cpuset,*cpusetp;
226228
size_t size;
227229
int ret;
228-
229-
#if defined(__GLIBC_PREREQ)
230230
#if !__GLIBC_PREREQ(2, 7)
231231
int i;
232232
#if !__GLIBC_PREREQ(2, 6)

f_check

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ if ($compiler eq "") {
7575

7676
} elsif ($data =~ /GNU/ || $data =~ /GCC/ ) {
7777

78+
$data =~ s/\(+.*?\)+//g;
7879
$data =~ /(\d+)\.(\d+).(\d+)/;
7980
$major = $1;
8081
$minor = $2;

kernel/x86_64/KERNEL.ZEN

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,5 @@ ZTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c
9797
CGEMM3MKERNEL = cgemm3m_kernel_8x4_haswell.c
9898
ZGEMM3MKERNEL = zgemm3m_kernel_4x4_haswell.c
9999

100+
SROTKERNEL = srot.c
101+
DROTKERNEL = drot.c

kernel/x86_64/dasum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#if defined(SKYLAKEX)
88
#include "dasum_microk_skylakex-2.c"
9-
#elif defined(HASWELL)
9+
#elif defined(HASWELL) || defined(ZEN)
1010
#include "dasum_microk_haswell-2.c"
1111
#endif
1212

kernel/x86_64/drot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#if defined(SKYLAKEX)
44
#include "drot_microk_skylakex-2.c"
5-
#elif defined(HASWELL)
5+
#elif defined(HASWELL) || defined(ZEN)
66
#include "drot_microk_haswell-2.c"
77
#endif
88

kernel/x86_64/sasum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#if defined(SKYLAKEX)
1313
#include "sasum_microk_skylakex-2.c"
14-
#elif defined(HASWELL)
14+
#elif defined(HASWELL) || defined(ZEN)
1515
#include "sasum_microk_haswell-2.c"
1616
#endif
1717

0 commit comments

Comments
 (0)