Skip to content

Commit 18eb6a7

Browse files
authored
Merge pull request #5519 from martin-frbg/issue5517
Introduce a minimum problem size requirement for multithreading in the hermitian operations
2 parents ef6f976 + c1c1285 commit 18eb6a7

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

interface/zher.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint n, FLOAT alpha,
177177
buffer = (FLOAT *)blas_memory_alloc(1);
178178

179179
#ifdef SMP
180-
nthreads = num_cpu_avail(2);
180+
if (n < 100)
181+
nthreads = 1;
182+
else
183+
nthreads = num_cpu_avail(2);
181184

182185
if (nthreads == 1) {
183186
#endif

interface/zher2.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint n, void *VALPHA
186186
buffer = (FLOAT *)blas_memory_alloc(1);
187187

188188
#ifdef SMP
189-
nthreads = num_cpu_avail(2);
189+
if (n < 100)
190+
nthreads = 1;
191+
else
192+
nthreads = num_cpu_avail(2);
190193

191194
if (nthreads == 1) {
192195
#endif

interface/zhpr.c

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

177177
#ifdef SMP
178-
nthreads = num_cpu_avail(2);
178+
if (n < 100)
179+
nthreads = 1;
180+
else
181+
nthreads = num_cpu_avail(2);
179182

180183
if (nthreads == 1) {
181184
#endif

interface/zhpr2.c

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

189189
#ifdef SMP
190-
nthreads = num_cpu_avail(2);
190+
if (n < 100)
191+
nthreads = 1;
192+
else
193+
nthreads = num_cpu_avail(2);
191194

192195
if (nthreads == 1) {
193196
#endif

0 commit comments

Comments
 (0)