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
This commit is contained in:
Martin Kroeker 2019-08-28 11:35:31 +02:00 committed by GitHub
parent 300f158d3b
commit 3a55dca2dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

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; zdot=OPENBLAS_MAKE_COMPLEX_FLOAT(0.0,0.0);
CIMAG(zdot) = 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); zdotr += CREAL(*ptr);
CIMAG(zdot) = CIMAG(zdot) + CIMAG(*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;
} }