Skip to content

Commit e3c262e

Browse files
authored
Merge pull request #1825 from brada4/hemv
Delay _hemv threading in attempt to address #1820
2 parents 71c6dee + a293bdc commit e3c262e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

interface/zhemv.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
#include "functable.h"
4444
#endif
4545

46+
// this is smallest dimension N of square input a to permit threading
47+
// see graph in issue #1820 for explanation
48+
#define MULTI_THREAD_MINIMAL 362
49+
4650
#ifdef XDOUBLE
4751
#define ERROR_NAME "XHEMV "
4852
#elif defined(DOUBLE)
@@ -195,7 +199,11 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint n, void *VALPHA
195199
buffer = (FLOAT *)blas_memory_alloc(1);
196200

197201
#ifdef SMP
198-
nthreads = num_cpu_avail(2);
202+
if (n<MULTI_THREAD_MINIMAL) {
203+
nthreads = 1 ;
204+
} else {
205+
nthreads = num_cpu_avail(2);
206+
};
199207

200208
if (nthreads == 1) {
201209
#endif

0 commit comments

Comments
 (0)