Commit b2d44e29 authored by Pavel Kus's avatar Pavel Kus

unification of _laset

parent 83c2b3fe
......@@ -32,12 +32,14 @@
#undef PRECISION_LAED4
#undef PRECISION_LAED5
#undef PRECISION_NRM2
#undef PRECISION_LASET
#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 scal_PRECISION_LASET
#undef PRECISION_SUFFIX
#undef CONST_0_0
......@@ -88,12 +90,14 @@
#define PRECISION_LAED4 DLAED4
#define PRECISION_LAED5 DLAED5
#define PRECISION_NRM2 DNRM2
#define PRECISION_LASET DLASET
#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 scal_PRECISION_LASET PDLASET
#define CONST_0_0 0.0_rk8
#define CONST_REAL_0_0 0.0_rk8
#define CONST_0_5 0.5_rk8
......@@ -141,12 +145,14 @@
#define PRECISION_LAED4 SLAED4
#define PRECISION_LAED5 SLAED5
#define PRECISION_NRM2 SNRM2
#define PRECISION_LASET SLASET
#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 scal_PRECISION_LASET PSLASET
#define CONST_0_0 0.0_rk4
#define CONST_REAL_0_0 0.0_rk4
#define CONST_0_5 0.5_rk4
......@@ -198,12 +204,14 @@
#undef PRECISION_LAED4
#undef PRECISION_LAED5
#undef PRECISION_DOTC
#undef PRECISION_LASET
#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 scal_PRECISION_LASET
#undef PRECISION_SUFFIX
#undef MPI_COMPLEX_PRECISION
#undef MPI_MATH_DATATYPE_PRECISION
......@@ -264,12 +272,14 @@
#define PRECISION_LAED4 ZLAED4
#define PRECISION_LAED5 ZLAED5
#define PRECISION_DOTC ZDOTC
#define PRECISION_LASET ZLASET
#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 scal_PRECISION_LASET PZLASET
#define MPI_COMPLEX_PRECISION MPI_DOUBLE_COMPLEX
#define MPI_MATH_DATATYPE_PRECISION MPI_DOUBLE_COMPLEX
#define MPI_COMPLEX_EXPLICIT_PRECISION MPI_COMPLEX16
......@@ -324,12 +334,14 @@
#define PRECISION_LAED4 CLAED4
#define PRECISION_LAED5 CLAED5
#define PRECISION_DOTC CDOTC
#define PRECISION_LASET CLASET
#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 scal_PRECISION_LASET PCLASET
#define MPI_COMPLEX_PRECISION MPI_COMPLEX
#define MPI_MATH_DATATYPE_PRECISION MPI_COMPLEX
#define MPI_COMPLEX_EXPLICIT_PRECISION MPI_COMPLEX8
......
......@@ -227,49 +227,12 @@
! Initialize tmp2 to unit matrix
tmp2 = 0
#if REALCASE == 1
#ifdef WITH_MPI
#ifdef DOUBLE_PRECISION_REAL
call pdlaset('A', nev, nev, 0.0_rk8, 1.0_rk8, tmp2, 1, 1, sc_desc)
#else
call pslaset('A', nev, nev, 0.0_rk4, 1.0_rk4, tmp2, 1, 1, sc_desc)
#endif
call scal_PRECISION_LASET('A', nev, nev, ZERO, ONE, tmp2, 1, 1, sc_desc)
#else /* WITH_MPI */
#ifdef DOUBLE_PRECISION_REAL
call dlaset('A',nev,nev,0.0_rk8,1.0_rk8,tmp2,na)
#else
call slaset('A',nev,nev,0.0_rk4,1.0_rk4,tmp2,na)
#endif
call PRECISION_LASET('A',nev,nev,ZERO,ONE,tmp2,na)
#endif /* WITH_MPI */
#endif /* REALCASE */
#if COMPLEXCASE == 1
#ifdef WITH_MPI
#ifdef DOUBLE_PRECISION_COMPLEX
call pzlaset('A', nev, nev, ZERO, ONE, tmp2, 1, 1, sc_desc)
#else
call pclaset('A', nev, nev, ZERO, ONE, tmp2, 1, 1, sc_desc)
#endif
#else /* WITH_MPI */
#ifdef DOUBLE_PRECISION_COMPLEX
call zlaset('A',nev,nev,ZERO,ONE,tmp2,na)
#else
call claset('A',nev,nev,ZERO,ONE,tmp2,na)
#endif
#endif /* WITH_MPI */
#endif /* COMPLEXCASE */
! ! tmp1 = Z**T * Z - Unit Matrix
tmp1(:,:) = tmp1(:,:) - tmp2(:,:)
......
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