Commit c95d2a2e authored by Andreas Marek's avatar Andreas Marek

Interfaces for Fortran calls to BLAS

parent ef098f42
......@@ -38,6 +38,7 @@ libelpa@SUFFIX@_private_la_SOURCES = \
src/elpa_autotune_impl.F90 \
src/elpa_abstract_impl.F90 \
src/helpers/mod_precision.F90 \
src/helpers/mod_blas_interfaces.F90 \
src/helpers/mod_mpi.F90 \
src/helpers/mod_mpi_stubs.F90 \
src/helpers/mod_omp.F90 \
......
......@@ -1415,7 +1415,7 @@ else
fi
dnl store-build-config
AC_MSG_CHECKING(whether build config should be compiled into the library)
echo "checking whether build config should be compiled into the library..."
AC_CHECK_PROG(xxd_CHECK,xxd,yes)
AS_IF([test x"$xxd_CHECK" != x"yes"], [AC_MSG_ERROR([Please install xxd before configuring.])])
AC_ARG_ENABLE([store-build-config],
......@@ -1429,10 +1429,12 @@ AC_ARG_ENABLE([store-build-config],
fi
],
[store_build_config=no])
AC_MSG_RESULT([${store_build_config}])
AM_CONDITIONAL([STORE_BUILD_CONFIG],[test x"$store_build_config" = x"yes"])
if test x"${store_build_config}" = x"yes"; then
echo "build config should be compiled into the library: yes"
AC_DEFINE([STORE_BUILD_CONFIG], [1], [compile build config into the library object])
else
echo "build config should be compiled into the library: no"
fi
......@@ -1451,7 +1453,7 @@ AC_CONFIG_FILES([
m4_include([m4/ax_fc_check_define.m4])
AC_MSG_CHECKING([if workaround for broken preprocessor is needed])
need_manual_cpp=yes
need_manual_cpp=no
AX_FC_CHECK_DEFINE([__INTEL_COMPILER],[is_intel=yes],[])
AX_FC_CHECK_DEFINE([__PGI],[is_pgi=yes],[])
ACTUAL_FC="$FC"
......
......@@ -62,6 +62,8 @@
use iso_c_binding
use precision
use elpa_abstract_impl
use elpa_blas_interfaces
#ifdef WITH_OPENMP
use omp_lib
#endif
......@@ -84,7 +86,7 @@
! might be larger as well!
integer(kind=ik), parameter :: max_strip=128
real(kind=REAL_DATATYPE) :: PRECISION_LAMCH, PRECISION_LAPY2
real(kind=REAL_DATATYPE) :: beta, sig, s, c, t, tau, rho, eps, tol, &
qtrans(2,2), dmax, zmax, d1new, d2new
real(kind=REAL_DATATYPE) :: z(na), d1(na), d2(na), z1(na), delta(na), &
......@@ -235,7 +237,7 @@
zmax = maxval(abs(z))
dmax = maxval(abs(d))
EPS = PRECISION_LAMCH( 'Epsilon' )
EPS = PRECISION_LAMCH( 'E' ) ! return epsilon
TOL = 8.0_rk*EPS*MAX(dmax,zmax)
! If the rank-1 modifier is small enough, no more needs to be done
......
......@@ -588,6 +588,8 @@ subroutine solve_tridi_&
! Takes precautions if DSTEDC fails or if the eigenvalues are not ordered correctly.
use precision
use elpa_abstract_impl
use elpa_blas_interfaces
implicit none
class(elpa_abstract_impl_t), intent(inout) :: obj
integer(kind=ik) :: nlen, ldq
......
......@@ -97,6 +97,8 @@
use iso_c_binding
use precision
use elpa_abstract_impl
use elpa_blas_interfaces
implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj
......
......@@ -103,6 +103,7 @@ call prmat(na,useGpu,a_mat,a_dev,lda,matrixCols,nblk,my_prow,my_pcol,np_rows,np_
use elpa_abstract_impl
use matrix_plot
use elpa_omp
use elpa_blas_interfaces
implicit none
#include "../general/precision_kinds.F90"
......
......@@ -49,6 +49,7 @@
use precision
use elpa_abstract_impl
use elpa_omp
use elpa_blas_interfaces
implicit none
#include "../general/precision_kinds.F90"
......
......@@ -57,6 +57,8 @@
use elpa_utilities
use elpa_mpi
use elpa_abstract_impl
use elpa_blas_interfaces
implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj
......
......@@ -107,7 +107,9 @@
use omp_lib
#endif
use precision
use elpa_blas_interfaces
use elpa_abstract_impl
implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj
......@@ -1154,7 +1156,7 @@
else ! useGPU
call obj%timer%start("blas")
call PRECISION_GEMM(BLAS_TRANS_OR_CONJ, 'N', &
call PRECISION_GEMM(BLAS_TRANS_OR_CONJ, 'N', &
lce-lcs+1, n_cols, lre, ONE, a_mat(1,lcs), ubound(a_mat,dim=1), &
vmrCPU, ubound(vmrCPU,dim=1), ONE, umcCPU(lcs,1), ubound(umcCPU,dim=1))
call obj%timer%stop("blas")
......
......@@ -101,6 +101,8 @@
!-------------------------------------------------------------------------------
use elpa_abstract_impl
use elpa2_workload
use elpa_blas_interfaces
use precision
implicit none
#include "../general/precision_kinds.F90"
......@@ -456,6 +458,8 @@
&(obj, n, nb, W, Y, tau, mem, lda)
use elpa_abstract_impl
use elpa_blas_interfaces
use precision
implicit none
#include "../general/precision_kinds.F90"
......@@ -489,6 +493,7 @@
use precision
use elpa_abstract_impl
use elpa_blas_interfaces
implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj
......@@ -516,6 +521,7 @@
use precision
use elpa_abstract_impl
use elpa_blas_interfaces
implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj
......@@ -544,6 +550,8 @@
&(obj, n, nb, A, lda, W, Y, mem, mem2, lda2)
use elpa_abstract_impl
use elpa_blas_interfaces
use precision
implicit none
#include "../general/precision_kinds.F90"
......
......@@ -101,6 +101,8 @@
use cuda_functions
use iso_c_binding
use elpa_abstract_impl
use elpa_blas_interfaces
implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj
......
......@@ -92,6 +92,8 @@
#ifdef WITH_OPENMP
use omp_lib
#endif
use elpa_blas_interfaces
implicit none
#include "../general/precision_kinds.F90"
class(elpa_abstract_impl_t), intent(inout) :: obj
......
This diff is collapsed.
......@@ -52,4 +52,6 @@ module precision
integer, parameter :: ck4 = C_FLOAT_COMPLEX
integer, parameter :: ik = C_INT32_T
integer, parameter :: lik = C_INT64_T
integer, parameter :: BLAS_KIND = C_INT32_T
end module precision
......@@ -46,6 +46,8 @@
&_&
&PRECISION&
& (na, nev, as, z, ev, sc_desc, nblk, myid, np_rows, np_cols, my_prow, my_pcol, bs) result(status)
use elpa_blas_interfaces
implicit none
#include "../../src/general/precision_kinds.F90"
integer(kind=ik) :: status
......@@ -57,9 +59,6 @@
MATH_DATATYPE(kind=rck) :: xc
#ifndef WITH_MPI
#if REALCASE == 1
real(kind=rck) :: dnrm2, snrm2
#endif
#if COMPLEXCASE == 1
complex(kind=rck) :: zdotc, cdotc
#endif /* COMPLEXCASE */
......
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