Skip to content

Commit 5fd871d

Browse files
authored
Introduce a lower limit for multithreading
1 parent 6ca9ffa commit 5fd871d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
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

0 commit comments

Comments
 (0)