Commit 235169e3 authored by Pavel Kus's avatar Pavel Kus

unify nrm2 and dotc

parent d3bdd635
......@@ -31,11 +31,13 @@
#undef PRECISION_LAPY2
#undef PRECISION_LAED4
#undef PRECISION_LAED5
#undef PRECISION_NRM2
#undef cublas_PRECISION_GEMM
#undef cublas_PRECISION_TRMM
#undef cublas_PRECISION_GEMV
#undef cublas_PRECISION_SYMV
#undef scal_PRECISION_GEMM
#undef scal_PRECISION_NRM2
#undef PRECISION_SUFFIX
#undef CONST_0_0
......@@ -84,11 +86,13 @@
#define PRECISION_LAPY2 DLAPY2
#define PRECISION_LAED4 DLAED4
#define PRECISION_LAED5 DLAED5
#define PRECISION_NRM2 DNRM2
#define cublas_PRECISION_GEMM cublas_DGEMM
#define cublas_PRECISION_TRMM cublas_DTRMM
#define cublas_PRECISION_GEMV cublas_DGEMV
#define cublas_PRECISION_SYMV cublas_DSYMV
#define scal_PRECISION_GEMM PDGEMM
#define scal_PRECISION_NRM2 PDNRM2
#define CONST_0_0 0.0_rk8
#define CONST_0_5 0.5_rk8
#define CONST_1_0 1.0_rk8
......@@ -134,11 +138,13 @@
#define PRECISION_LAPY2 SLAPY2
#define PRECISION_LAED4 SLAED4
#define PRECISION_LAED5 SLAED5
#define PRECISION_NRM2 SNRM2
#define cublas_PRECISION_GEMM cublas_SGEMM
#define cublas_PRECISION_TRMM cublas_STRMM
#define cublas_PRECISION_GEMV cublas_SGEMV
#define cublas_PRECISION_SYMV cublas_SSYMV
#define scal_PRECISION_GEMM PSGEMM
#define scal_PRECISION_NRM2 PSNRM2
#define CONST_0_0 0.0_rk4
#define CONST_0_5 0.5_rk4
#define CONST_1_0 1.0_rk4
......@@ -188,11 +194,13 @@
#undef PRECISION_LAPY2
#undef PRECISION_LAED4
#undef PRECISION_LAED5
#undef PRECISION_DOTC
#undef cublas_PRECISION_GEMM
#undef cublas_PRECISION_TRMM
#undef cublas_PRECISION_GEMV
#undef cublas_PRECISION_SYMV
#undef scal_PRECISION_GEMM
#undef scal_PRECISION_DOTC
#undef PRECISION_SUFFIX
#undef MPI_COMPLEX_PRECISION
#undef MPI_MATH_DATATYPE_PRECISION
......@@ -213,6 +221,7 @@
#undef CONST_COMPLEX_1_0
#undef C_DATATYPE_KIND
#undef THRESHOLD
/* General definitions needed in single and double case */
......@@ -251,11 +260,13 @@
#define PRECISION_LAPY2 ZLAPY2
#define PRECISION_LAED4 ZLAED4
#define PRECISION_LAED5 ZLAED5
#define PRECISION_DOTC ZDOTC
#define cublas_PRECISION_GEMM cublas_ZGEMM
#define cublas_PRECISION_TRMM cublas_ZTRMM
#define cublas_PRECISION_GEMV cublas_ZGEMV
#define cublas_PRECISION_SYMV cublas_ZSYMV
#define scal_PRECISION_GEMM PZGEMM
#define scal_PRECISION_DOTC PZDOTC
#define MPI_COMPLEX_PRECISION MPI_DOUBLE_COMPLEX
#define MPI_MATH_DATATYPE_PRECISION MPI_DOUBLE_COMPLEX
#define MPI_COMPLEX_EXPLICIT_PRECISION MPI_COMPLEX16
......@@ -309,11 +320,13 @@
#define PRECISION_LAPY2 CLAPY2
#define PRECISION_LAED4 CLAED4
#define PRECISION_LAED5 CLAED5
#define PRECISION_DOTC CDOTC
#define cublas_PRECISION_GEMM cublas_CGEMM
#define cublas_PRECISION_TRMM cublas_CTRMM
#define cublas_PRECISION_GEMV cublas_CGEMV
#define cublas_PRECISION_SYMV cublas_CSYMV
#define scal_PRECISION_GEMM PCGEMM
#define scal_PRECISION_DOTC PCDOTC
#define MPI_COMPLEX_PRECISION MPI_COMPLEX
#define MPI_MATH_DATATYPE_PRECISION MPI_COMPLEX
#define MPI_COMPLEX_EXPLICIT_PRECISION MPI_COMPLEX8
......
......@@ -187,22 +187,9 @@
#endif
#ifdef WITH_MPI
#ifdef DOUBLE_PRECISION_REAL
call pdnrm2(na, err, tmp1, 1, i, sc_desc, 1)
#else
call psnrm2(na, err, tmp1, 1, i, sc_desc, 1)
#endif
call scal_PRECISION_NRM2(na, err, tmp1, 1, i, sc_desc, 1)
#else /* WITH_MPI */
#ifdef DOUBLE_PRECISION_REAL
! call dnrm2(na,err,tmp1,1,i,sc_desc,1)
err = dnrm2(na,tmp1(1,i),1)
#else
err = snrm2(na,tmp1(1,i),1)
#endif
err = PRECISION_NRM2(na,tmp1(1,i),1)
#endif /* WITH_MPI */
errmax = max(errmax, err)
#endif /* REALCASE */
......@@ -210,21 +197,9 @@
#if COMPLEXCASE == 1
xc = 0
#ifdef WITH_MPI
#ifdef DOUBLE_PRECISION_COMPLEX
call pzdotc(na, xc, tmp1, 1, i, sc_desc, 1, tmp1, 1, i, sc_desc, 1)
#else
call pcdotc(na, xc, tmp1, 1, i, sc_desc, 1, tmp1, 1, i, sc_desc, 1)
#endif
call scal_PRECISION_DOTC(na, xc, tmp1, 1, i, sc_desc, 1, tmp1, 1, i, sc_desc, 1)
#else /* WITH_MPI */
#ifdef DOUBLE_PRECISION_COMPLEX
xc = zdotc(na,tmp1,1,tmp1,1)
#else
xc = cdotc(na,tmp1,1,tmp1,1)
#endif
xc = PRECISION_DOTC(na,tmp1,1,tmp1,1)
#endif /* WITH_MPI */
......
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