Skip to content

Commit 96d2f2c

Browse files
authored
Merge pull request #1831 from brada4/hemv
disable threading in C/ZSWAP copying from S/DSWAP
2 parents 653e657 + 2992e38 commit 96d2f2c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

interface/zswap.c

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

45+
#if defined(THUNDERX2T99) || defined(VULCAN) || defined(ARMV8)
46+
// Multithreaded swap gives performance benefits in ThunderX2T99
47+
#else
48+
// Disable multi-threading as it does not show any performance
49+
// benefits. Keep the multi-threading code for the record.
50+
#undef SMP
51+
#endif
52+
4553
#ifndef CBLAS
4654

4755
void NAME(blasint *N, FLOAT *x, blasint *INCX, FLOAT *y, blasint *INCY){
@@ -81,7 +89,7 @@ FLOAT *y = (FLOAT*)vy;
8189
#ifdef SMP
8290
//disable multi-thread when incx==0 or incy==0
8391
//In that case, the threads would be dependent.
84-
if (incx == 0 || incy == 0)
92+
if (incx == 0 || incy == 0 || n < 1048576 * GEMM_MULTITHREAD_THRESHOLD / sizeof(FLOAT))
8593
nthreads = 1;
8694
else
8795
nthreads = num_cpu_avail(1);

0 commit comments

Comments
 (0)