Commit 7c19d880 authored by Pavel Kus's avatar Pavel Kus
Browse files

single/double unification of elpa1_compute_complex_template.X90

Conflicts:
	src/elpa1_compute_complex_template.X90
parent c2037d4e
......@@ -56,7 +56,8 @@ EXTRA_libelpa@SUFFIX@_private_la_DEPENDENCIES = \
src/elpa2_kernels/elpa2_kernels_complex_template.X90 \
src/elpa2_kernels/elpa2_kernels_simple_template.X90 \
src/redist_band.X90 \
src/precision_macros.h
src/precision_macros.h \
src/precision_macros_complex.h
lib_LTLIBRARIES = libelpa@SUFFIX@.la
libelpa@SUFFIX@_la_LINK = $(FCLINK) $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION)
......@@ -888,6 +889,7 @@ EXTRA_DIST = \
src/elpa2_compute_real_template.X90 \
src/elpa2_compute_complex_template.X90 \
src/precision_macros.h \
src/precision_macros_complex.h \
src/elpa2_kernels/elpa2_kernels_real_template.X90 \
src/elpa2_kernels/elpa2_kernels_complex_template.X90 \
src/elpa2_kernels/elpa2_kernels_simple_template.X90 \
......
#!/usr/bin/python
simple_tokens = ["tridiag_complex_PRECISION",
"trans_ev_complex_PRECISION",
"solve_complex_PRECISION",
"hh_transform_complex_PRECISION",
"elpa_transpose_vectors_complex_PRECISION",
"elpa_reduce_add_vectors_complex_PRECISION",
]
blas_tokens = ["PRECISION_GEMV",
"PRECISION_TRMV",
"PRECISION_GEMM",
"PRECISION_TRMM",
"PRECISION_HERK",
]
explicit_tokens = [("PRECISION_SUFFIX", "\"_double\"", "\"_single\""),
("MPI_COMPLEX_PRECISION", "MPI_DOUBLE_COMPLEX", "MPI_COMPLEX"),
("MPI_REAL_PRECISION", "MPI_REAL8", "MPI_REAL4"),
("KIND_PRECISION", "rk8", "rk4"),
("PRECISION_CMPLX", "DCMPLX", "CMPLX"),
("PRECISION_IMAG", "DIMAG", "AIMAG"),
("CONST_REAL_0_0", "0.0_rk8", "0.0_rk4"),
("CONST_REAL_1_0", "1.0_rk8", "1.0_rk4"),
]
print "#ifdef DOUBLE_PRECISION_COMPLEX"
for token in simple_tokens:
print "#define ", token, token.replace("PRECISION", "double")
for token in blas_tokens:
print "#define ", token, token.replace("PRECISION_", "Z")
for token in explicit_tokens:
print "#define ", token[0], token[1]
print "#else"
for token in simple_tokens:
print "#undef ", token
for token in blas_tokens:
print "#undef ", token
for token in explicit_tokens:
print "#undef ", token[0]
for token in simple_tokens:
print "#define ", token, token.replace("PRECISION", "single")
for token in blas_tokens:
print "#define ", token, token.replace("PRECISION_", "C")
for token in explicit_tokens:
print "#define ", token[0], token[2]
print "#endif"
This diff is collapsed.
#ifdef DOUBLE_PRECISION_COMPLEX
#define tridiag_complex_PRECISION tridiag_complex_double
#define trans_ev_complex_PRECISION trans_ev_complex_double
#define solve_complex_PRECISION solve_complex_double
#define hh_transform_complex_PRECISION hh_transform_complex_double
#define elpa_transpose_vectors_complex_PRECISION elpa_transpose_vectors_complex_double
#define elpa_reduce_add_vectors_complex_PRECISION elpa_reduce_add_vectors_complex_double
#define PRECISION_GEMV ZGEMV
#define PRECISION_TRMV ZTRMV
#define PRECISION_GEMM ZGEMM
#define PRECISION_TRMM ZTRMM
#define PRECISION_HERK ZHERK
#define PRECISION_SUFFIX "_double"
#define MPI_COMPLEX_PRECISION MPI_DOUBLE_COMPLEX
#define MPI_REAL_PRECISION MPI_REAL8
#define KIND_PRECISION rk8
#define PRECISION_CMPLX DCMPLX
#define PRECISION_IMAG DIMAG
#define CONST_REAL_0_0 0.0_rk8
#define CONST_REAL_1_0 1.0_rk8
#else
#undef tridiag_complex_PRECISION
#undef trans_ev_complex_PRECISION
#undef solve_complex_PRECISION
#undef hh_transform_complex_PRECISION
#undef elpa_transpose_vectors_complex_PRECISION
#undef elpa_reduce_add_vectors_complex_PRECISION
#undef PRECISION_GEMV
#undef PRECISION_TRMV
#undef PRECISION_GEMM
#undef PRECISION_TRMM
#undef PRECISION_HERK
#undef PRECISION_SUFFIX
#undef MPI_COMPLEX_PRECISION
#undef MPI_REAL_PRECISION
#undef KIND_PRECISION
#undef PRECISION_CMPLX
#undef PRECISION_IMAG
#undef CONST_REAL_0_0
#undef CONST_REAL_1_0
#define tridiag_complex_PRECISION tridiag_complex_single
#define trans_ev_complex_PRECISION trans_ev_complex_single
#define solve_complex_PRECISION solve_complex_single
#define hh_transform_complex_PRECISION hh_transform_complex_single
#define elpa_transpose_vectors_complex_PRECISION elpa_transpose_vectors_complex_single
#define elpa_reduce_add_vectors_complex_PRECISION elpa_reduce_add_vectors_complex_single
#define PRECISION_GEMV CGEMV
#define PRECISION_TRMV CTRMV
#define PRECISION_GEMM CGEMM
#define PRECISION_TRMM CTRMM
#define PRECISION_HERK CHERK
#define PRECISION_SUFFIX "_single"
#define MPI_COMPLEX_PRECISION MPI_COMPLEX
#define MPI_REAL_PRECISION MPI_REAL4
#define KIND_PRECISION rk4
#define PRECISION_CMPLX CMPLX
#define PRECISION_IMAG AIMAG
#define CONST_REAL_0_0 0.0_rk4
#define CONST_REAL_1_0 1.0_rk4
#endif
......@@ -184,7 +184,13 @@ program test_real_double_precision
print *
print '(a)','Standard eigenvalue problem - ELPA1, REAL version'
print *
print '(3(a,i0))','Matrix size=',na,', Number of eigenvectors=',nev,', Block size=',nblk
print '((a,i0))', 'Num MPI proc: ', nprocs
print '((a,i0))', 'Matrix size: ', na
print '((a,i0))', 'Num eigenvectors: ', nev
print '((a,i0))', 'Blocksize: ', nblk
print '((a))', 'Using gpu: NO'
print *
! print '((a,i0))','Matrix size=',na,', Number of eigenvectors=',nev,', Block size=',nblk
print '(3(a,i0))','Number of processor rows=',np_rows,', cols=',np_cols,', total=',nprocs
print *
endif
......
......@@ -190,11 +190,21 @@ program test_real_gpu_version_double_precision
if(myid==0) then
print *
print '(a)','Standard eigenvalue problem - REAL version'
! if (gpuAvailable) then
! print *,"with GPU Version"
! endif
print *
print '((a,i0))', 'Num MPI proc: ', nprocs
print '((a,i0))', 'Matrix size: ', na
print '((a,i0))', 'Num eigenvectors: ', nev
print '((a,i0))', 'Blocksize: ', nblk
if (gpuAvailable) then
print *,"with GPU Version"
print '((a))', 'Using gpu: YES'
else
print '((a))', 'Using gpu: NO, not available'
endif
print *
print '(3(a,i0))','Matrix size=',na,', Number of eigenvectors=',nev,', Block size=',nblk
! print '(3(a,i0))','Matrix size=',na,', Number of eigenvectors=',nev,', Block size=',nblk
print '(3(a,i0))','Number of processor rows=',np_rows,', cols=',np_cols,', total=',nprocs
print *
endif
......
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