Browse Source

Fixed #6. Disable multi-thread swap when incx==0 or incy==0.

tags/v0.1alpha1
Xianyi Zhang 15 years ago
parent
commit
78da0e0a0c
2 changed files with 11 additions and 1 deletions
  1. +6
    -1
      interface/swap.c
  2. +5
    -0
      interface/zswap.c

+ 6
- 1
interface/swap.c View File

@@ -78,7 +78,12 @@ void CNAME(blasint n, FLOAT *x, blasint incx, FLOAT *y, blasint incy){

#ifdef SMP
nthreads = num_cpu_avail(1);

//disable multi-thread when incx==0 or incy==0
//In that case, the threads would be dependent.
if (incx == 0 || incy == 0)
nthreads = 1;
if (nthreads == 1) {
#endif



+ 5
- 0
interface/zswap.c View File

@@ -80,6 +80,11 @@ void CNAME(blasint n, FLOAT *x, blasint incx, FLOAT *y, blasint incy){
#ifdef SMP
nthreads = num_cpu_avail(1);

//disable multi-thread when incx==0 or incy==0
//In that case, the threads would be dependent.
if (incx == 0 || incy == 0)
nthreads = 1;

if (nthreads == 1) {
#endif



Loading…
Cancel
Save