Commit 3ecff0df authored by Mathieu Faverge's avatar Mathieu Faverge

Remove COMPLEX/REAL from testings

parent 5c9befff
......@@ -28,10 +28,6 @@
#include <sys/resource.h>
#endif
#include <morse.h>
#undef REAL
#define COMPLEX
#undef SINGLE
#define DOUBLE
#include "testing_zauxiliary.h"
int IONE = 1;
......@@ -199,7 +195,7 @@ int main (int argc, char **argv)
else if ( strcmp(func, "GEMM") == 0 ) {
info += testing_zgemm( argc, argv );
}
#ifdef COMPLEX
#if defined(PRECISION_z) || defined(PRECISION_c)
else if ( strcmp(func, "HEMM") == 0 ) {
info += testing_zhemm( argc, argv );
}
......
......@@ -35,9 +35,6 @@
#include <mpi.h>
#endif
#undef REAL
#define COMPLEX
static int check_tr_solution(MORSE_enum uplo, MORSE_enum trans, int M, int N,
MORSE_Complex64_t alpha, MORSE_Complex64_t *A, int LDA,
MORSE_Complex64_t beta, MORSE_Complex64_t *Bref, MORSE_Complex64_t *Bmorse, int LDB);
......@@ -105,7 +102,7 @@ int testing_zgeadd(int argc, char **argv)
LAPACKE_zlarnv_work(IONE, ISEED, LDAxN, A);
LAPACKE_zlarnv_work(IONE, ISEED, LDBxN, B);
#ifdef COMPLEX
#if defined(PRECISION_z) || defined(PRECISION_c)
for (t=0; t<3; t++) {
#else
for (t=0; t<2; t++) {
......@@ -143,7 +140,7 @@ int testing_zgeadd(int argc, char **argv)
LAPACKE_zlarnv_work(IONE, ISEED, LDAxN, A);
LAPACKE_zlarnv_work(IONE, ISEED, LDBxN, B);
#ifdef COMPLEX
#if defined(PRECISION_z) || defined(PRECISION_c)
for (t=0; t<3; t++) {
#else
for (t=0; t<2; t++) {
......
......@@ -34,9 +34,6 @@
#include <coreblas.h>
#include "testing_zauxiliary.h"
#undef REAL
#define COMPLEX
enum blas_order_type {
blas_rowmajor = 101,
blas_colmajor = 102 };
......
......@@ -30,9 +30,6 @@
#include <coreblas.h>
#include "testing_zauxiliary.h"
#undef REAL
#define COMPLEX
static int check_orthogonality(int, int, int, MORSE_Complex64_t*, double);
static int check_factorization(int, int, MORSE_Complex64_t*, MORSE_Complex64_t*, int, MORSE_Complex64_t*, double);
static int check_solution(int, int, int, MORSE_Complex64_t*, int, MORSE_Complex64_t*, MORSE_Complex64_t*, int, double);
......
......@@ -30,9 +30,6 @@
#include <coreblas.h>
#include "testing_zauxiliary.h"
#undef REAL
#define COMPLEX
static int check_orthogonality(int, int, int, MORSE_Complex64_t*, double);
static int check_factorization(int, int, MORSE_Complex64_t*, MORSE_Complex64_t*, int, MORSE_Complex64_t*, double);
static int check_solution(int, int, int, MORSE_Complex64_t*, int, MORSE_Complex64_t*, MORSE_Complex64_t*, int, double);
......
......@@ -35,9 +35,6 @@
#include <mpi.h>
#endif
#undef REAL
#define COMPLEX
static int check_solution(MORSE_enum transA, MORSE_enum transB, int M, int N, int K,
MORSE_Complex64_t alpha, MORSE_Complex64_t *A, int LDA,
MORSE_Complex64_t *B, int LDB,
......@@ -113,7 +110,7 @@ int testing_zgemm(int argc, char **argv)
LAPACKE_zlarnv_work(IONE, ISEED, LDBxN, B);
LAPACKE_zlarnv_work(IONE, ISEED, LDCxN, C);
#ifdef COMPLEX
#if defined(PRECISION_z) || defined(PRECISION_c)
for (ta=0; ta<3; ta++) {
for (tb=0; tb<3; tb++) {
#else
......
......@@ -35,9 +35,6 @@
#include <coreblas/coreblas_z.h>
#include "testing_zauxiliary.h"
#undef REAL
#define COMPLEX
static int check_orthogonality(int, int, const MORSE_Complex64_t*, int, double);
static int check_factorization(int, int, const MORSE_Complex64_t*, int, const MORSE_Complex64_t*, int, MORSE_Complex64_t*, int, double);
......
......@@ -33,7 +33,7 @@
#include "testing_zauxiliary.h"
static int check_solution(MORSE_enum uplo, MORSE_enum trans, int N, int K,
MORSE_Complex64_t alpha, MORSE_Complex64_t *A, int LDA,
MORSE_Complex64_t alpha, MORSE_Complex64_t *A, int LDA,
MORSE_Complex64_t *B, int LDB,
double beta, MORSE_Complex64_t *Cref, MORSE_Complex64_t *Cmorse, int LDC);
......@@ -112,12 +112,12 @@ int testing_zher2k(int argc, char **argv)
memcpy(Cinit, C, LDCxN*sizeof(MORSE_Complex64_t));
memcpy(Cfinal, C, LDCxN*sizeof(MORSE_Complex64_t));
/* MORSE ZHER2K */
MORSE_zher2k(uplo[u], trans[t], N, K, alpha, A, LDA, B, LDB, beta, Cfinal, LDC);
/* Check the solution */
info_solution = check_solution(uplo[u], trans[t], N, K,
info_solution = check_solution(uplo[u], trans[t], N, K,
alpha, A, LDA, B, LDB, beta, Cinit, Cfinal, LDC);
if (info_solution == 0) {
......@@ -156,16 +156,16 @@ static int check_solution(MORSE_enum uplo, MORSE_enum trans, int N, int K,
double *work = (double *)malloc(max(N, K)* sizeof(double));
beta_const = -1.0;
Anorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I',
(trans == MorseNoTrans) ? N : K,
Anorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I',
(trans == MorseNoTrans) ? N : K,
(trans == MorseNoTrans) ? K : N, A, LDA, work);
Bnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I',
(trans == MorseNoTrans) ? N : K,
Bnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I',
(trans == MorseNoTrans) ? N : K,
(trans == MorseNoTrans) ? K : N, B, LDB, work);
Cinitnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', N, N, Cref, LDC, work);
Cmorsenorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', N, N, Cmorse, LDC, work);
cblas_zher2k(CblasColMajor, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans,
cblas_zher2k(CblasColMajor, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans,
N, K, CBLAS_SADDR(alpha), A, LDA, B, LDB, (beta), Cref, LDC);
Clapacknorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', N, N, Cref, LDC, work);
......@@ -175,7 +175,7 @@ static int check_solution(MORSE_enum uplo, MORSE_enum trans, int N, int K,
Rnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', N, N, Cref, LDC, work);
eps = LAPACKE_dlamch_work('e');
printf("Rnorm %e, Anorm %e, Cinitnorm %e, Cmorsenorm %e, Clapacknorm %e\n",
Rnorm, Anorm, Cinitnorm, Cmorsenorm, Clapacknorm);
......
......@@ -31,9 +31,6 @@
#include <coreblas.h>
#include "testing_zauxiliary.h"
#undef REAL
#define COMPLEX
int testing_zlange(int argc, char **argv)
{
int hres = 0;
......@@ -111,50 +108,50 @@ int testing_zlange(int argc, char **argv)
}
#ifdef COMPLEX
/* MORSE ZLANTR */
for(n=1; n<3; n++) {
for(u=0; u<2; u++) {
int d;
for(d=0; d<2; d++) {
normmorse = MORSE_zlantr(norm[n], uplo[u], diag[d], M, N, A, LDA);
normlapack = LAPACKE_zlantr_work(LAPACK_COL_MAJOR, morse_lapack_const(norm[n]), morse_lapack_const(uplo[u]),
morse_lapack_const(diag[d]), M, N, A, LDA, work);
printf("LAPACK %e, CHAMELEON %e\n", normlapack, normmorse);
result = fabs(normmorse - normlapack) / (normlapack * eps);
switch(norm[n]) {
case MorseMaxNorm:
/* result should be perfectly equal */
break;
case MorseInfNorm:
/* Sum order on the line can differ */
result = result / (double)N;
break;
case MorseOneNorm:
/* Sum order on the column can differ */
result = result / (double)M;
break;
case MorseFrobeniusNorm:
/* Sum oreder on every element can differ */
result = result / ((double)M * (double)N);
break;
}
printf("***************************************************\n");
if ( result < 1. ) {
printf(" ---- TESTING ZLANTR (%s, %s, %s)......... PASSED !\n",
normstr[n], uplostr[u], diagstr[d]);
}
else {
printf(" - TESTING ZLANTR (%s, %s, %s)... FAILED !\n",
normstr[n], uplostr[u], diagstr[d]);
}
printf("***************************************************\n");
#if defined(PRECISION_z) || defined(PRECISION_c)
/* MORSE ZLANTR */
for(n=1; n<3; n++) {
for(u=0; u<2; u++) {
int d;
for(d=0; d<2; d++) {
normmorse = MORSE_zlantr(norm[n], uplo[u], diag[d], M, N, A, LDA);
normlapack = LAPACKE_zlantr_work(LAPACK_COL_MAJOR, morse_lapack_const(norm[n]), morse_lapack_const(uplo[u]),
morse_lapack_const(diag[d]), M, N, A, LDA, work);
printf("LAPACK %e, CHAMELEON %e\n", normlapack, normmorse);
result = fabs(normmorse - normlapack) / (normlapack * eps);
switch(norm[n]) {
case MorseMaxNorm:
/* result should be perfectly equal */
break;
case MorseInfNorm:
/* Sum order on the line can differ */
result = result / (double)N;
break;
case MorseOneNorm:
/* Sum order on the column can differ */
result = result / (double)M;
break;
case MorseFrobeniusNorm:
/* Sum oreder on every element can differ */
result = result / ((double)M * (double)N);
break;
}
printf("***************************************************\n");
if ( result < 1. ) {
printf(" ---- TESTING ZLANTR (%s, %s, %s)......... PASSED !\n",
normstr[n], uplostr[u], diagstr[d]);
}
else {
printf(" - TESTING ZLANTR (%s, %s, %s)... FAILED !\n",
normstr[n], uplostr[u], diagstr[d]);
}
printf("***************************************************\n");
}
}
#endif
}
#endif
/* MORSE ZLANSY */
for(n=0; n<4; n++) {
......@@ -193,51 +190,51 @@ int testing_zlange(int argc, char **argv)
}
}
#ifdef COMPLEX
/* MORSE ZLANHE */
{
int j;
for (j=0; j<min(M,N); j++) {
#if defined(PRECISION_z) || defined(PRECISION_c)
/* MORSE ZLANHE */
{
int j;
for (j=0; j<min(M,N); j++) {
A[j*LDA+j] -= I*cimag(A[j*LDA+j]);
}
}
}
for(n=0; n<4; n++) {
for(u=0; u<2; u++) {
normmorse = MORSE_zlanhe(norm[n], uplo[u], min(M,N), A, LDA);
normlapack = LAPACKE_zlanhe_work(LAPACK_COL_MAJOR, morse_lapack_const(norm[n]), morse_lapack_const(uplo[u]), min(M,N), A, LDA, work);
printf("LAPACK %e, CHAMELEON %e\n", normlapack, normmorse);
for(n=0; n<4; n++) {
for(u=0; u<2; u++) {
normmorse = MORSE_zlanhe(norm[n], uplo[u], min(M,N), A, LDA);
normlapack = LAPACKE_zlanhe_work(LAPACK_COL_MAJOR, morse_lapack_const(norm[n]), morse_lapack_const(uplo[u]), min(M,N), A, LDA, work);
printf("LAPACK %e, CHAMELEON %e\n", normlapack, normmorse);
result = fabs(normmorse - normlapack) / (normlapack * eps);
switch(norm[n]) {
case MorseMaxNorm:
/* result should be perfectly equal */
break;
case MorseInfNorm:
/* Sum order on the line can differ */
result = result / (double)N;
break;
case MorseOneNorm:
/* Sum order on the column can differ */
result = result / (double)M;
break;
case MorseFrobeniusNorm:
/* Sum oreder on every element can differ */
result = result / ((double)M * (double)N);
break;
}
result = fabs(normmorse - normlapack) / (normlapack * eps);
switch(norm[n]) {
case MorseMaxNorm:
/* result should be perfectly equal */
break;
case MorseInfNorm:
/* Sum order on the line can differ */
result = result / (double)N;
break;
case MorseOneNorm:
/* Sum order on the column can differ */
result = result / (double)M;
break;
case MorseFrobeniusNorm:
/* Sum oreder on every element can differ */
result = result / ((double)M * (double)N);
break;
}
printf("***************************************************\n");
if ( result < 1. ) {
printf(" ---- TESTING ZLANHE (%s, %s)......... PASSED !\n", normstr[n], uplostr[u]);
}
else {
printf(" - TESTING ZLANHE (%s, %s)... FAILED !\n", normstr[n], uplostr[u]);
}
printf("***************************************************\n");
printf("***************************************************\n");
if ( result < 1. ) {
printf(" ---- TESTING ZLANHE (%s, %s)......... PASSED !\n", normstr[n], uplostr[u]);
}
else {
printf(" - TESTING ZLANHE (%s, %s)... FAILED !\n", normstr[n], uplostr[u]);
}
printf("***************************************************\n");
}
#endif
}
#endif
free(A);
free(work);
......
......@@ -31,9 +31,6 @@
#include <coreblas.h>
#include "testing_zauxiliary.h"
#define COMPLEX
#undef REAL
/*--------------------------------------------------------------
* Check the pemv
*/
......@@ -164,7 +161,7 @@ int testing_zpemv(int argc, char **argv)
}
/* Colwise ConjTrans & Rowwise NoTrans */
#ifdef COMPLEX
#if defined(PRECISION_z) || defined(PRECISION_c)
for (t=0; t<3; t++)
#else
for (t=0; t<2; t++)
......
......@@ -33,7 +33,7 @@
#include "testing_zauxiliary.h"
static int check_solution(MORSE_enum uplo, MORSE_enum trans, int N, int K,
MORSE_Complex64_t alpha, MORSE_Complex64_t *A, int LDA,
MORSE_Complex64_t alpha, MORSE_Complex64_t *A, int LDA,
MORSE_Complex64_t *B, int LDB,
MORSE_Complex64_t beta, MORSE_Complex64_t *Cref, MORSE_Complex64_t *Cmorse, int LDC);
......@@ -112,12 +112,12 @@ int testing_zsyr2k(int argc, char **argv)
memcpy(Cinit, C, LDCxN*sizeof(MORSE_Complex64_t));
memcpy(Cfinal, C, LDCxN*sizeof(MORSE_Complex64_t));
/* MORSE ZSYR2K */
MORSE_zsyr2k(uplo[u], trans[t], N, K, alpha, A, LDA, B, LDB, beta, Cfinal, LDC);
/* Check the solution */
info_solution = check_solution(uplo[u], trans[t], N, K,
info_solution = check_solution(uplo[u], trans[t], N, K,
alpha, A, LDA, B, LDB, beta, Cinit, Cfinal, LDC);
if (info_solution == 0) {
......@@ -156,16 +156,16 @@ static int check_solution(MORSE_enum uplo, MORSE_enum trans, int N, int K,
double *work = (double *)malloc(max(N, K)* sizeof(double));
beta_const = -1.0;
Anorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I',
(trans == MorseNoTrans) ? N : K,
Anorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I',
(trans == MorseNoTrans) ? N : K,
(trans == MorseNoTrans) ? K : N, A, LDA, work);
Bnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I',
(trans == MorseNoTrans) ? N : K,
Bnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I',
(trans == MorseNoTrans) ? N : K,
(trans == MorseNoTrans) ? K : N, B, LDB, work);
Cinitnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', N, N, Cref, LDC, work);
Cmorsenorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', N, N, Cmorse, LDC, work);
cblas_zsyr2k(CblasColMajor, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans,
cblas_zsyr2k(CblasColMajor, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans,
N, K, CBLAS_SADDR(alpha), A, LDA, B, LDB, CBLAS_SADDR(beta), Cref, LDC);
Clapacknorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', N, N, Cref, LDC, work);
......@@ -175,7 +175,7 @@ static int check_solution(MORSE_enum uplo, MORSE_enum trans, int N, int K,
Rnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'I', N, N, Cref, LDC, work);
eps = LAPACKE_dlamch_work('e');
printf("Rnorm %e, Anorm %e, Cinitnorm %e, Cmorsenorm %e, Clapacknorm %e\n",
Rnorm, Anorm, Cinitnorm, Cmorsenorm, Clapacknorm);
......
......@@ -32,9 +32,6 @@
#include <coreblas.h>
#include "testing_zauxiliary.h"
#undef REAL
#define COMPLEX
static int check_solution(MORSE_enum side, MORSE_enum uplo, MORSE_enum trans, MORSE_enum diag,
int M, int N, MORSE_Complex64_t alpha,
MORSE_Complex64_t *A, int LDA,
......@@ -103,7 +100,7 @@ int testing_ztrmm(int argc, char **argv)
for (s=0; s<2; s++) {
for (u=0; u<2; u++) {
#ifdef COMPLEX
#if defined(PRECISION_z) || defined(PRECISION_c)
for (t=0; t<3; t++) {
#else
for (t=0; t<2; t++) {
......
......@@ -32,9 +32,6 @@
#include <coreblas.h>
#include "testing_zauxiliary.h"
#undef REAL
#define COMPLEX
static int check_solution(MORSE_enum side, MORSE_enum uplo, MORSE_enum trans, MORSE_enum diag,
int M, int N, MORSE_Complex64_t alpha,
MORSE_Complex64_t *A, int LDA,
......@@ -103,7 +100,7 @@ int testing_ztrsm(int argc, char **argv)
for (s=0; s<2; s++) {
for (u=0; u<2; u++) {
#ifdef COMPLEX
#if defined(PRECISION_z) || defined(PRECISION_c)
for (t=0; t<3; t++) {
#else
for (t=0; t<2; t++) {
......
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