Browse Source

Make x86_64 zdot compile with PGI and Sun C again

broken by #2222 as CREAL,CIMAG do not expand to a valid lvalue with these compilers
tags/v0.3.8^2
Martin Kroeker GitHub 6 years ago
parent
commit
3a55dca2dc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      kernel/x86_64/zdot.c

+ 7
- 5
kernel/x86_64/zdot.c View File

@@ -181,10 +181,10 @@ OPENBLAS_COMPLEX_FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLA
#if defined(SMP) #if defined(SMP)
int nthreads; int nthreads;
FLOAT dummy_alpha; FLOAT dummy_alpha;
FLOAT zdotr=0., zdoti=0.;
#endif #endif
OPENBLAS_COMPLEX_FLOAT zdot; OPENBLAS_COMPLEX_FLOAT zdot;
CREAL(zdot) = 0.0;
CIMAG(zdot) = 0.0;
zdot=OPENBLAS_MAKE_COMPLEX_FLOAT(0.0,0.0);


#if defined(SMP) #if defined(SMP)
if (inc_x == 0 || inc_y == 0 || n <= 10000) if (inc_x == 0 || inc_y == 0 || n <= 10000)
@@ -211,15 +211,17 @@ OPENBLAS_COMPLEX_FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLA


ptr = (OPENBLAS_COMPLEX_FLOAT *)result; ptr = (OPENBLAS_COMPLEX_FLOAT *)result;
for (i = 0; i < nthreads; i++) { for (i = 0; i < nthreads; i++) {
CREAL(zdot) = CREAL(zdot) + CREAL(*ptr);
CIMAG(zdot) = CIMAG(zdot) + CIMAG(*ptr);
zdotr += CREAL(*ptr);
zdoti += CIMAG(*ptr);
// CREAL(zdot) = CREAL(zdot) + CREAL(*ptr);
// CIMAG(zdot) = CIMAG(zdot) + CIMAG(*ptr);
ptr = (void *)(((char *)ptr) + sizeof(double) * 2); ptr = (void *)(((char *)ptr) + sizeof(double) * 2);
} }
zdot = OPENBLAS_MAKE_COMPLEX_FLOAT(zdotr,zdoti);
} }
#else #else
zdot_compute(n, x, inc_x, y, inc_y, &zdot); zdot_compute(n, x, inc_x, y, inc_y, &zdot);
#endif #endif

return zdot; return zdot;
} }



Loading…
Cancel
Save