Commit 401a7513 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Remove COMPLEX/REAL from coreblas

parent 88409dc2
......@@ -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 );
......
......@@ -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
......@@ -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
......@@ -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
......@@ -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 );
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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
......
......@@ -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(
......
......@@ -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
......
......@@ -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(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment