Skip to content

Commit a9e8fa0

Browse files
authored
Introduce a (crude) threshold to multithreading
1 parent b4c2b34 commit a9e8fa0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

interface/trmv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo,
219219

220220
#ifdef SMP
221221
nthreads = num_cpu_avail(2);
222-
222+
223+
if (n < 50 ) nthreads = 1;
224+
if (nthreads > 2 && n < 500) nthreads = 2;
225+
223226
if (nthreads == 1) {
224227
#endif
225228

0 commit comments

Comments
 (0)