Skip to content

Commit 68ef232

Browse files
authored
Merge pull request #4388 from martin-frbg/issue4387
Add lower limit for multithreading in the reimplemented LAPACK ?GESV
2 parents 6777917 + a7ed60b commit 68ef232

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

interface/lapack/gesv.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,14 @@ int NAME(blasint *N, blasint *NRHS, FLOAT *a, blasint *ldA, blasint *ipiv,
114114

115115
#ifdef SMP
116116
args.common = NULL;
117-
args.nthreads = num_cpu_avail(4);
117+
#ifndef DOUBLE
118+
if (args.m*args.n < 40000)
119+
#else
120+
if (args.m*args.n < 10000)
121+
#endif
122+
args.nthreads=1;
123+
else
124+
args.nthreads = num_cpu_avail(4);
118125

119126
if (args.nthreads == 1) {
120127
#endif

0 commit comments

Comments
 (0)