Merge pull request #1126 from martin-frbg/pgi
Fix compilation with PGI by replacing verbatim _real_, _imag_ extensions and updating macro definitions for modern, C99-capable versions of the PGI compiler
This commit is contained in:
commit
ad124a5e8b
9
common.h
9
common.h
|
@ -556,8 +556,13 @@ static void __inline blas_lock(volatile BLASULONG *address){
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(C_PGI) || defined(C_SUN)
|
#if defined(C_PGI) || defined(C_SUN)
|
||||||
#define CREAL(X) (*((FLOAT *)&X + 0))
|
#if defined(__STDC_IEC_559_COMPLEX__)
|
||||||
#define CIMAG(X) (*((FLOAT *)&X + 1))
|
#define CREAL(X) creal(X)
|
||||||
|
#define CIMAG(X) cimag(X)
|
||||||
|
#else
|
||||||
|
#define CREAL(X) (*((FLOAT *)&X + 0))
|
||||||
|
#define CIMAG(X) (*((FLOAT *)&X + 1))
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#ifdef OPENBLAS_COMPLEX_STRUCT
|
#ifdef OPENBLAS_COMPLEX_STRUCT
|
||||||
#define CREAL(Z) ((Z).real)
|
#define CREAL(Z) ((Z).real)
|
||||||
|
|
|
@ -160,9 +160,10 @@ OPENBLAS_COMPLEX_FLOAT CNAME(blasint n, FLOAT *x, blasint incx, FLOAT *y, blasin
|
||||||
|
|
||||||
if (n <= 0) {
|
if (n <= 0) {
|
||||||
#ifdef FORCE_USE_STACK
|
#ifdef FORCE_USE_STACK
|
||||||
//*result = OPENBLAS_MAKE_COMPLEX_FLOAT(0.0, 0.0);
|
OPENBLAS_COMPLEX_FLOAT zero=OPENBLAS_MAKE_COMPLEX_FLOAT(0.0, 0.0);
|
||||||
CREAL(*result) = 0.0;
|
*result = zero;
|
||||||
CIMAG(*result) = 0.0;
|
// CREAL(*result) = 0.0;
|
||||||
|
// CIMAG(*result) = 0.0;
|
||||||
return;
|
return;
|
||||||
#else
|
#else
|
||||||
return zero;
|
return zero;
|
||||||
|
|
|
@ -100,8 +100,7 @@ FLOAT _Complex CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG in
|
||||||
|
|
||||||
if ( n <= 0 )
|
if ( n <= 0 )
|
||||||
{
|
{
|
||||||
__real__ result = 0.0 ;
|
result = OPENBLAS_MAKE_COMPLEX_FLOAT (0.0, 0.0) ;
|
||||||
__imag__ result = 0.0 ;
|
|
||||||
return(result);
|
return(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -161,11 +160,13 @@ FLOAT _Complex CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG in
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(CONJ)
|
#if !defined(CONJ)
|
||||||
__real__ result = dot[0] - dot[1];
|
result = OPENBLAS_MAKE_COMPLEX_FLOAT (dot[0]-dot[1], dot[4]+dot[5]) ;
|
||||||
__imag__ result = dot[4] + dot[5];
|
// CREAL(result) = dot[0] - dot[1];
|
||||||
|
// CIMAG(result) = dot[4] + dot[5];
|
||||||
#else
|
#else
|
||||||
__real__ result = dot[0] + dot[1];
|
result = OPENBLAS_MAKE_COMPLEX_FLOAT (dot[0]+dot[1], dot[4]-dot[5]) ;
|
||||||
__imag__ result = dot[4] - dot[5];
|
// CREAL(result) = dot[0] + dot[1];
|
||||||
|
// CIMAG(result) = dot[4] - dot[5];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -95,8 +95,9 @@ FLOAT _Complex CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG in
|
||||||
|
|
||||||
if ( n <= 0 )
|
if ( n <= 0 )
|
||||||
{
|
{
|
||||||
__real__ result = 0.0 ;
|
// CREAL(result) = 0.0 ;
|
||||||
__imag__ result = 0.0 ;
|
// CIMAG(result) = 0.0 ;
|
||||||
|
result=OPENBLAS_MAKE_COMPLEX_FLOAT(0.0,0.0);
|
||||||
return(result);
|
return(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -150,11 +151,13 @@ FLOAT _Complex CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG in
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(CONJ)
|
#if !defined(CONJ)
|
||||||
__real__ result = dot[0] - dot[1];
|
result=OPENBLAS_MAKE_COMPLEX_FLOAT(dot[0]-dot[1],dot[2]+dot[3]);
|
||||||
__imag__ result = dot[2] + dot[3];
|
// CREAL(result) = dot[0] - dot[1];
|
||||||
|
// CIMAG(result) = dot[2] + dot[3];
|
||||||
#else
|
#else
|
||||||
__real__ result = dot[0] + dot[1];
|
result=OPENBLAS_MAKE_COMPLEX_FLOAT(dot[0]+dot[1],dot[2]-dot[3]);
|
||||||
__imag__ result = dot[2] - dot[3];
|
// CREAL(result) = dot[0] + dot[1];
|
||||||
|
// CIMAG(result) = dot[2] - dot[3];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue