Use new solver when available

This commit is contained in:
Pietro 2020-09-10 19:35:24 +00:00 committed by giannozz
parent db419cfd7a
commit fce35f8830
3 changed files with 80 additions and 25 deletions

4
install/aclocal.m4 vendored
View File

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

81
install/configure vendored
View File

@ -742,7 +742,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -840,7 +839,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1093,15 +1091,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1239,7 +1228,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1392,7 +1381,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -1441,7 +1429,7 @@ Optional Packages:
--with-cuda=PATH prefix where CUDA is installed [default=no]
--with-cuda-cc=VAL GPU architecture (Kepler: 35, Pascal: 60, Volta: 70)
[default=35]
--with-cuda-runtime=VAL CUDA runtime (Pascal: 8.0, Volta: 9.0) [default=8.0]
--with-cuda-runtime=VAL CUDA runtime (Pascal: 8+, Volta: 9+) [default=10.1]
--with-libxc (yes|no) Use libXC for some XC functionals (default:
no)
--with-libxc-prefix=DIR Directory where libxc was installed.
@ -4414,7 +4402,7 @@ fi
if test "${with_cuda_runtime+set}" = set; then :
withval=$with_cuda_runtime;
else
with_cuda_runtime=8.0
with_cuda_runtime=10.1
fi
@ -4899,6 +4887,55 @@ See \`config.log' for more details" "$LINENO" 5; }
fi
new_cusolver="yes"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cusolverDnZhegvdx_bufferSize in -lcusolver" >&5
$as_echo_n "checking for cusolverDnZhegvdx_bufferSize in -lcusolver... " >&6; }
if ${ac_cv_lib_cusolver_cusolverDnZhegvdx_bufferSize+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcusolver $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char cusolverDnZhegvdx_bufferSize ();
int
main ()
{
return cusolverDnZhegvdx_bufferSize ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_cusolver_cusolverDnZhegvdx_bufferSize=yes
else
ac_cv_lib_cusolver_cusolverDnZhegvdx_bufferSize=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cusolver_cusolverDnZhegvdx_bufferSize" >&5
$as_echo "$ac_cv_lib_cusolver_cusolverDnZhegvdx_bufferSize" >&6; }
if test "x$ac_cv_lib_cusolver_cusolverDnZhegvdx_bufferSize" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBCUSOLVER 1
_ACEOF
LIBS="-lcusolver $LIBS"
else
new_cusolver="no"
fi
# Returning to the original flags
CXXFLAGS=${ax_save_CXXFLAGS}
LIBS=${ax_save_LIBS}
@ -4907,12 +4944,20 @@ fi
$as_echo "#define HAVE_CUDA 1" >>confdefs.h
try_dflags="$try_dflags -D__CUDA"
cuda_fflags="-Mcuda=cc$with_cuda_cc,cuda$with_cuda_runtime \$(MOD_FLAG)\$(TOPDIR)/EIGENSOLVER_GPU/lib_eigsolve"
if test ${new_cusolver} != yes; then
cuda_fflags="-Mcuda=cc$with_cuda_cc,cuda$with_cuda_runtime \$(MOD_FLAG)\$(TOPDIR)/EIGENSOLVER_GPU/lib_eigsolve"
cuda_extlibs="eigensolver"
cuda_libs="-Mcudalib=cufft,cublas,cusolver \$(TOPDIR)/EIGENSOLVER_GPU/lib_eigsolve/lib_eigsolve.a"
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Using legacy custom solver." >&5
$as_echo "$as_me: WARNING: Using legacy custom solver." >&2;}
else
cuda_fflags="-Mcuda=cc$with_cuda_cc,cuda$with_cuda_runtime"
cuda_libs="-Mcudalib=cufft,cublas,cusolver"
try_dflags="$try_dflags -D__USE_CUSOLVER"
fi
ldflags="$ldflags -Mcuda=cc$with_cuda_cc,cuda$with_cuda_runtime"
gpu_arch="$with_cuda_cc"
gpu_runtime="$with_cuda_runtime"
cuda_libs="-Mcudalib=cufft,cublas,cusolver \$(TOPDIR)/EIGENSOLVER_GPU/lib_eigsolve/lib_eigsolve.a"
cuda_extlibs="eigensolver"
fi
# Announcing the new variables

View File

@ -49,9 +49,9 @@ AC_ARG_WITH([cuda-cc],
[with_cuda_cc=35])
AC_ARG_WITH([cuda-runtime],
[AS_HELP_STRING([--with-cuda-runtime=VAL],[CUDA runtime (Pascal: 8.0, Volta: 9.0) @<:@default=8.0@:>@])],
[AS_HELP_STRING([--with-cuda-runtime=VAL],[CUDA runtime (Pascal: 8+, Volta: 9+) @<:@default=10.1@:>@])],
[],
[with_cuda_runtime=8.0])
[with_cuda_runtime=10.1])
@ -150,6 +150,9 @@ EOF
AC_CHECK_LIB([cudart], [cudaMalloc], [], AC_MSG_FAILURE([Couldn't find libcudart]))
AC_CHECK_LIB([cublas], [cublasInit], [], AC_MSG_FAILURE([Couldn't find libcublas]))
AC_CHECK_LIB([cufft], [cufftPlanMany], [], AC_MSG_FAILURE([Couldn't find libcufft]))
new_cusolver="yes"
AC_CHECK_LIB([cusolver], [cusolverDnZhegvdx_bufferSize], [], new_cusolver="no")
# Returning to the original flags
CXXFLAGS=${ax_save_CXXFLAGS}
@ -157,12 +160,19 @@ EOF
AC_DEFINE(HAVE_CUDA,1,[Define if we have CUDA])
try_dflags="$try_dflags -D__CUDA"
cuda_fflags="-Mcuda=cc$with_cuda_cc,cuda$with_cuda_runtime \$(MOD_FLAG)\$(TOPDIR)/EIGENSOLVER_GPU/lib_eigsolve"
if test ${new_cusolver} != yes; then
cuda_fflags="-Mcuda=cc$with_cuda_cc,cuda$with_cuda_runtime \$(MOD_FLAG)\$(TOPDIR)/EIGENSOLVER_GPU/lib_eigsolve"
cuda_extlibs="eigensolver"
cuda_libs="-Mcudalib=cufft,cublas,cusolver \$(TOPDIR)/EIGENSOLVER_GPU/lib_eigsolve/lib_eigsolve.a"
AC_MSG_WARN([Using legacy custom solver.])
else
cuda_fflags="-Mcuda=cc$with_cuda_cc,cuda$with_cuda_runtime"
cuda_libs="-Mcudalib=cufft,cublas,cusolver"
try_dflags="$try_dflags -D__USE_CUSOLVER"
fi
ldflags="$ldflags -Mcuda=cc$with_cuda_cc,cuda$with_cuda_runtime"
gpu_arch="$with_cuda_cc"
gpu_runtime="$with_cuda_runtime"
cuda_libs="-Mcudalib=cufft,cublas,cusolver \$(TOPDIR)/EIGENSOLVER_GPU/lib_eigsolve/lib_eigsolve.a"
cuda_extlibs="eigensolver"
fi
# Announcing the new variables