Skip to content

Commit 39c9606

Browse files
authored
Merge pull request #4694 from martin-frbg/issue3660
Add a minimum problem size for multithreading in GBMV
2 parents f5c080f + 2957281 commit 39c9606

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

interface/gbmv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ void CNAME(enum CBLAS_ORDER order,
227227
buffer = (FLOAT *)blas_memory_alloc(1);
228228

229229
#ifdef SMP
230-
nthreads = num_cpu_avail(2);
230+
if (m * n < 250000 || kl+ku < 15 )
231+
nthreads = 1;
232+
else
233+
nthreads = num_cpu_avail(2);
231234

232235
if (nthreads == 1) {
233236
#endif

interface/zgbmv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ void CNAME(enum CBLAS_ORDER order,
251251
buffer = (FLOAT *)blas_memory_alloc(1);
252252

253253
#ifdef SMP
254-
nthreads = num_cpu_avail(2);
254+
if (m * n < 125000 || ku + kl < 15)
255+
nthreads = 1;
256+
else
257+
nthreads = num_cpu_avail(2);
255258

256259
if (nthreads == 1) {
257260
#endif

0 commit comments

Comments
 (0)