diff --git a/coreblas/compute/core_zgessq.c b/coreblas/compute/core_zgessq.c index ac4547a370101b0e008e07b383f8810854aac3f2..9a8723dbd3974b7f9683a5a5d7653041b12ee482 100644 --- a/coreblas/compute/core_zgessq.c +++ b/coreblas/compute/core_zgessq.c @@ -23,8 +23,6 @@ #include "coreblas/lapacke.h" #include "coreblas.h" -#define COMPLEX - #define UPDATE( __nb, __value ) \ if (__value != 0. ){ \ if ( *scale < __value ) { \ @@ -89,7 +87,6 @@ * \retval -k, the k-th argument had an illegal value * */ - int CORE_zgessq(int M, int N, const MORSE_Complex64_t *A, int LDA, double *scale, double *sumsq) @@ -104,7 +101,7 @@ int CORE_zgessq(int M, int N, tmp = fabs(*ptr); UPDATE( 1., tmp ); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) ptr++; tmp = fabs(*ptr); UPDATE( 1., tmp ); diff --git a/coreblas/compute/core_zhemm.c b/coreblas/compute/core_zhemm.c index ba7255f9cb26077177e95f77a4c52afc58d89335..c908bd7e891529c77cb063ba35319f6c95f10363 100644 --- a/coreblas/compute/core_zhemm.c +++ b/coreblas/compute/core_zhemm.c @@ -25,9 +25,6 @@ */ #include "coreblas.h" -#undef REAL -#define COMPLEX -#ifdef COMPLEX /** * * @ingroup CORE_MORSE_Complex64_t @@ -47,6 +44,3 @@ void CORE_zhemm(MORSE_enum side, MORSE_enum uplo, B, LDB, CBLAS_SADDR(beta), C, LDC); } - - -#endif diff --git a/coreblas/compute/core_zher2k.c b/coreblas/compute/core_zher2k.c index 8b894f50be7feb8bc612be0cbcc9cba314f7cc5c..f7af24a7dcab8dc69a089c5238e7a7707ee77db1 100644 --- a/coreblas/compute/core_zher2k.c +++ b/coreblas/compute/core_zher2k.c @@ -25,9 +25,6 @@ */ #include "coreblas.h" -#undef REAL -#define COMPLEX -#ifdef COMPLEX /** * * @ingroup CORE_MORSE_Complex64_t @@ -46,6 +43,3 @@ void CORE_zher2k(MORSE_enum uplo, MORSE_enum trans, CBLAS_SADDR(alpha), A, LDA, B, LDB, beta, C, LDC); } - - -#endif diff --git a/coreblas/compute/core_zherk.c b/coreblas/compute/core_zherk.c index bff780e94a1f0d0f7dbedf395aa23ee2470b69cd..ec57c9e35838d1921208595927948bb6998d8b61 100644 --- a/coreblas/compute/core_zherk.c +++ b/coreblas/compute/core_zherk.c @@ -25,9 +25,6 @@ */ #include "coreblas.h" -#undef REAL -#define COMPLEX -#ifdef COMPLEX /** * * @ingroup CORE_MORSE_Complex64_t @@ -45,6 +42,3 @@ void CORE_zherk(MORSE_enum uplo, MORSE_enum trans, alpha, A, LDA, beta, C, LDC); } - - -#endif diff --git a/coreblas/compute/core_zhessq.c b/coreblas/compute/core_zhessq.c index 427c62cc210a67b87604f65957d297bf65e1d589..23915b59a3a5252be0e03ff59d6998a8bc57cc25 100644 --- a/coreblas/compute/core_zhessq.c +++ b/coreblas/compute/core_zhessq.c @@ -23,8 +23,6 @@ #include "coreblas/lapacke.h" #include "coreblas.h" -#define COMPLEX - #define UPDATE( __nb, __value ) \ if (__value != 0. ){ \ if ( *scale < __value ) { \ @@ -113,7 +111,7 @@ int CORE_zhessq(MORSE_enum uplo, int N, tmp = fabs(*ptr); UPDATE( 2., tmp ); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) ptr++; tmp = fabs(*ptr); UPDATE( 2., tmp ); @@ -124,7 +122,7 @@ int CORE_zhessq(MORSE_enum uplo, int N, tmp = fabs(*ptr); UPDATE( 1., tmp ); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) ptr++; #endif } @@ -138,7 +136,7 @@ int CORE_zhessq(MORSE_enum uplo, int N, UPDATE( 1., tmp ); ptr++; -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) ptr++; #endif @@ -147,7 +145,7 @@ int CORE_zhessq(MORSE_enum uplo, int N, tmp = fabs(*ptr); UPDATE( 2., tmp ); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) ptr++; tmp = fabs(*ptr); UPDATE( 2., tmp ); diff --git a/coreblas/compute/core_zplghe.c b/coreblas/compute/core_zplghe.c index ff9f984a88df9d226a07c1887cdd21c2fd9463dd..6c5d16f423b8a2416b941b18e176c591cc439566 100644 --- a/coreblas/compute/core_zplghe.c +++ b/coreblas/compute/core_zplghe.c @@ -25,9 +25,6 @@ */ #include "coreblas.h" -#define COMPLEX -#undef REAL - /* Rnd64seed is a global variable but it doesn't spoil thread safety. All matrix generating threads only read Rnd64seed. It is safe to set Rnd64seed before @@ -41,7 +38,7 @@ #define RndF_Mul 5.4210108624275222e-20f #define RndD_Mul 5.4210108624275222e-20 -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) #define NBELEM 2 #else #define NBELEM 1 @@ -87,7 +84,7 @@ void CORE_zplghe( double bump, int m, int n, MORSE_Complex64_t *A, int lda, for (i = j; i < m; i++) { *tmp = 0.5f - ran * RndF_Mul; ran = Rnd64_A * ran + Rnd64_C; -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) *tmp += I*(0.5f - ran * RndF_Mul); ran = Rnd64_A * ran + Rnd64_C; #endif @@ -98,7 +95,7 @@ void CORE_zplghe( double bump, int m, int n, MORSE_Complex64_t *A, int lda, } for (j = 0; j < n; j++) { -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) A[j+j*lda] += bump - I*cimag( A[j+j*lda] ); #else A[j+j*lda] += bump; @@ -119,7 +116,7 @@ void CORE_zplghe( double bump, int m, int n, MORSE_Complex64_t *A, int lda, for (i = 0; i < m; i++) { *tmp = 0.5f - ran * RndF_Mul; ran = Rnd64_A * ran + Rnd64_C; -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) *tmp += I*(0.5f - ran * RndF_Mul); ran = Rnd64_A * ran + Rnd64_C; #endif @@ -142,7 +139,7 @@ void CORE_zplghe( double bump, int m, int n, MORSE_Complex64_t *A, int lda, for (j = 0; j < n; j++) { A[j*lda+i] = 0.5f - ran * RndF_Mul; ran = Rnd64_A * ran + Rnd64_C; -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) A[j*lda+i] -= I*(0.5f - ran * RndF_Mul); ran = Rnd64_A * ran + Rnd64_C; #endif diff --git a/coreblas/compute/core_zplgsy.c b/coreblas/compute/core_zplgsy.c index 4f61012aea9c2fa887764eec92a7920188d84fc6..e2af54bdb3c2196539eb9fa65875f160ee518b6c 100644 --- a/coreblas/compute/core_zplgsy.c +++ b/coreblas/compute/core_zplgsy.c @@ -25,9 +25,6 @@ */ #include "coreblas.h" -#define COMPLEX -#undef REAL - /* Rnd64seed is a global variable but it doesn't spoil thread safety. All matrix generating threads only read Rnd64seed. It is safe to set Rnd64seed before @@ -41,7 +38,7 @@ #define RndF_Mul 5.4210108624275222e-20f #define RndD_Mul 5.4210108624275222e-20 -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) #define NBELEM 2 #else #define NBELEM 1 @@ -88,7 +85,7 @@ void CORE_zplgsy( MORSE_Complex64_t bump, int m, int n, MORSE_Complex64_t *A, in for (i = j; i < m; i++) { *tmp = 0.5f - ran * RndF_Mul; ran = Rnd64_A * ran + Rnd64_C; -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) *tmp += I*(0.5f - ran * RndF_Mul); ran = Rnd64_A * ran + Rnd64_C; #endif @@ -116,7 +113,7 @@ void CORE_zplgsy( MORSE_Complex64_t bump, int m, int n, MORSE_Complex64_t *A, in for (i = 0; i < m; i++) { *tmp = 0.5f - ran * RndF_Mul; ran = Rnd64_A * ran + Rnd64_C; -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) *tmp += I*(0.5f - ran * RndF_Mul); ran = Rnd64_A * ran + Rnd64_C; #endif @@ -139,7 +136,7 @@ void CORE_zplgsy( MORSE_Complex64_t bump, int m, int n, MORSE_Complex64_t *A, in for (j = 0; j < n; j++) { A[j*lda+i] = 0.5f - ran * RndF_Mul; ran = Rnd64_A * ran + Rnd64_C; -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) A[j*lda+i] += I*(0.5f - ran * RndF_Mul); ran = Rnd64_A * ran + Rnd64_C; #endif diff --git a/coreblas/compute/core_zplrnt.c b/coreblas/compute/core_zplrnt.c index f272dd3f9b682244cc4a8b29ac0712fcf2d89d93..8f4971dabf71fba964f563406d14031ee8940d17 100644 --- a/coreblas/compute/core_zplrnt.c +++ b/coreblas/compute/core_zplrnt.c @@ -25,9 +25,6 @@ */ #include "coreblas.h" -#define COMPLEX -#undef REAL - /* Rnd64seed is a global variable but it doesn't spoil thread safety. All matrix generating threads only read Rnd64seed. It is safe to set Rnd64seed before @@ -41,7 +38,7 @@ #define RndF_Mul 5.4210108624275222e-20f #define RndD_Mul 5.4210108624275222e-20 -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) #define NBELEM 2 #else #define NBELEM 1 @@ -82,7 +79,7 @@ void CORE_zplrnt( int m, int n, MORSE_Complex64_t *A, int lda, for (i = 0; i < m; ++i) { *tmp = 0.5f - ran * RndF_Mul; ran = Rnd64_A * ran + Rnd64_C; -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) *tmp += I*(0.5f - ran * RndF_Mul); ran = Rnd64_A * ran + Rnd64_C; #endif diff --git a/coreblas/compute/core_zsyssq.c b/coreblas/compute/core_zsyssq.c index 80b16a4ccb51cce643cad75864e6187180fb2dff..b1c16e6f3f70fd6b9e47a0a9652ecc141d0d24bd 100644 --- a/coreblas/compute/core_zsyssq.c +++ b/coreblas/compute/core_zsyssq.c @@ -23,8 +23,6 @@ #include "coreblas/lapacke.h" #include "coreblas.h" -#define COMPLEX - #define UPDATE( __nb, __value ) \ if (__value != 0. ){ \ if ( *scale < __value ) { \ @@ -113,7 +111,7 @@ int CORE_zsyssq(MORSE_enum uplo, int N, tmp = fabs(*ptr); UPDATE( 2., tmp ); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) ptr++; tmp = fabs(*ptr); UPDATE( 2., tmp ); @@ -124,7 +122,7 @@ int CORE_zsyssq(MORSE_enum uplo, int N, tmp = fabs(*ptr); UPDATE( 1., tmp ); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) ptr++; tmp = fabs(*ptr); UPDATE( 1., tmp ); @@ -140,7 +138,7 @@ int CORE_zsyssq(MORSE_enum uplo, int N, UPDATE( 1., tmp ); ptr++; -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) tmp = fabs(*ptr); UPDATE( 1., tmp ); ptr++; @@ -151,7 +149,7 @@ int CORE_zsyssq(MORSE_enum uplo, int N, tmp = fabs(*ptr); UPDATE( 2., tmp ); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) ptr++; tmp = fabs(*ptr); UPDATE( 2., tmp ); diff --git a/coreblas/compute/core_ztrssq.c b/coreblas/compute/core_ztrssq.c index 53eb52f0fa22fb005265ff0f77ecfabf61c0afb9..207768b32ea696cff98b390daa2c08036be94d0c 100644 --- a/coreblas/compute/core_ztrssq.c +++ b/coreblas/compute/core_ztrssq.c @@ -23,8 +23,6 @@ #include "coreblas/lapacke.h" #include "coreblas.h" -#define COMPLEX - #define UPDATE( __nb, __value ) \ if (__value != 0. ){ \ if ( *scale < __value ) { \ @@ -115,7 +113,7 @@ int CORE_ztrssq(MORSE_enum uplo, MORSE_enum diag, int M, int N, tmp = fabs(*ptr); UPDATE( 1., tmp ); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) ptr++; tmp = fabs(*ptr); UPDATE( 1., tmp ); @@ -133,7 +131,7 @@ int CORE_ztrssq(MORSE_enum uplo, MORSE_enum diag, int M, int N, tmp = fabs(*ptr); UPDATE( 1., tmp ); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) ptr++; tmp = fabs(*ptr); UPDATE( 1., tmp ); diff --git a/coreblas/compute/core_ztslqt.c b/coreblas/compute/core_ztslqt.c index 67817bc412ceb1c01c63eb1d73b3912a5a275007..ce9e955dfd93cd057bfaf21b780119d917958597 100644 --- a/coreblas/compute/core_ztslqt.c +++ b/coreblas/compute/core_ztslqt.c @@ -25,8 +25,6 @@ */ #include "coreblas/lapacke.h" #include "coreblas.h" -#undef REAL -#define COMPLEX /** * @@ -142,7 +140,7 @@ int CORE_ztslqt(int M, int N, int IB, /* * Generate elementary reflector H( II*IB+I ) to annihilate A( II*IB+I, II*IB+I:N ). */ -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) LAPACKE_zlacgv_work(N, &A2[ii+i], LDA2); LAPACKE_zlacgv_work(1, &A1[LDA1*(ii+i)+ii+i], LDA1); #endif @@ -184,7 +182,7 @@ int CORE_ztslqt(int M, int N, int IB, CBLAS_SADDR(alpha), &A2[ii], LDA2, &A2[ii+i], LDA2, CBLAS_SADDR(zzero), &T[LDT*(ii+i)], 1); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) LAPACKE_zlacgv_work(N, &A2[ii+i], LDA2 ); LAPACKE_zlacgv_work(1, &A1[LDA1*(ii+i)+ii+i], LDA1 ); #endif diff --git a/coreblas/compute/core_ztsqrt.c b/coreblas/compute/core_ztsqrt.c index 2a811493e5f0accd3f794a5e7c9e8bd990e1e35b..92841443166aca0fe9806131a10a282d318150fe 100644 --- a/coreblas/compute/core_ztsqrt.c +++ b/coreblas/compute/core_ztsqrt.c @@ -25,8 +25,6 @@ */ #include "coreblas/lapacke.h" #include "coreblas.h" -#undef REAL -#define COMPLEX /** * @@ -144,7 +142,7 @@ int CORE_ztsqrt(int M, int N, int IB, sb-i-1, &A1[LDA1*(ii+i+1)+(ii+i)], LDA1, WORK, 1); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) LAPACKE_zlacgv_work(sb-i-1, WORK, 1); #endif cblas_zgemv( @@ -153,14 +151,14 @@ int CORE_ztsqrt(int M, int N, int IB, CBLAS_SADDR(zone), &A2[LDA2*(ii+i+1)], LDA2, &A2[LDA2*(ii+i)], 1, CBLAS_SADDR(zone), WORK, 1); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) LAPACKE_zlacgv_work(sb-i-1, WORK, 1 ); #endif cblas_zaxpy( sb-i-1, CBLAS_SADDR(alpha), WORK, 1, &A1[LDA1*(ii+i+1)+ii+i], LDA1); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) LAPACKE_zlacgv_work(sb-i-1, WORK, 1 ); #endif cblas_zgerc( diff --git a/coreblas/compute/core_zttlqt.c b/coreblas/compute/core_zttlqt.c index 4930772b9e9d0229105875dd6aedead4bc06d5dc..3c0aa09b83070f07a8698e7f92cb857edaeff3fb 100644 --- a/coreblas/compute/core_zttlqt.c +++ b/coreblas/compute/core_zttlqt.c @@ -25,8 +25,6 @@ */ #include "coreblas/lapacke.h" #include "coreblas.h" -#undef REAL -#define COMPLEX /** * @@ -111,7 +109,7 @@ int CORE_zttlqt(int M, int N, int IB, { static MORSE_Complex64_t zone = 1.0; static MORSE_Complex64_t zzero = 0.0; -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) static int ione = 1; #endif @@ -154,7 +152,7 @@ int CORE_zttlqt(int M, int N, int IB, /* * Generate elementary reflector H( II*IB+I ) to annihilate A( II*IB+I, II*IB+I:M ). */ -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) LAPACKE_zlacgv_work(ni, &A2[j], LDA2); LAPACKE_zlacgv_work(ione, &A1[LDA1*j+j], LDA1); #endif @@ -216,7 +214,7 @@ int CORE_zttlqt(int M, int N, int IB, } -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) LAPACKE_zlacgv_work(ni, &A2[j], LDA2 ); LAPACKE_zlacgv_work(ione, &A1[LDA1*j+j], LDA1 ); #endif diff --git a/coreblas/compute/core_zttqrt.c b/coreblas/compute/core_zttqrt.c index f2d4dfbcf5b66b0708c7e1f6d0d09049999948fd..a55d6d7d38736331d3ebf7833af8524d2e7de619 100644 --- a/coreblas/compute/core_zttqrt.c +++ b/coreblas/compute/core_zttqrt.c @@ -25,8 +25,6 @@ */ #include "coreblas/lapacke.h" #include "coreblas.h" -#undef REAL -#define COMPLEX /** * @@ -166,7 +164,7 @@ int CORE_zttqrt(int M, int N, int IB, &A1[LDA1*(j+1)+j], LDA1, WORK, 1); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) LAPACKE_zlacgv_work(ni, WORK, 1); #endif cblas_zgemv( @@ -175,7 +173,7 @@ int CORE_zttqrt(int M, int N, int IB, CBLAS_SADDR(zone), &A2[LDA2*(j+1)], LDA2, &A2[LDA2*j], 1, CBLAS_SADDR(zone), WORK, 1); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) LAPACKE_zlacgv_work(ni, WORK, 1); #endif alpha = -conj(TAU[j]); @@ -183,7 +181,7 @@ int CORE_zttqrt(int M, int N, int IB, ni, CBLAS_SADDR(alpha), WORK, 1, &A1[LDA1*(j+1)+j], LDA1); -#ifdef COMPLEX +#if defined(PRECISION_z) || defined(PRECISION_c) LAPACKE_zlacgv_work(ni, WORK, 1); #endif cblas_zgerc(