Skip to content

Commit 02920be

Browse files
authored
Merge pull request #3953 from martin-frbg/issue3801
Do not use multithreading for small SYMV/SYR2K workloads
2 parents 2885e4d + 2441474 commit 02920be

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

interface/symv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint n, FLOAT alpha,
180180
buffer = (FLOAT *)blas_memory_alloc(1);
181181

182182
#ifdef SMP
183+
if (n <200)
184+
nthreads=1;
185+
else
183186
nthreads = num_cpu_avail(2);
184187

185188
if (nthreads == 1) {

interface/syr2k.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Tr
368368
mode |= (uplo << BLAS_UPLO_SHIFT);
369369

370370
args.common = NULL;
371+
if (args.n*args.k <1000)
372+
args.nthreads =1 ;
373+
else
371374
args.nthreads = num_cpu_avail(3);
372375

373376
if (args.nthreads == 1) {

0 commit comments

Comments
 (0)