diff --git a/config/pac.m4 b/config/pac.m4 index 83356540..a39256e0 100644 --- a/config/pac.m4 +++ b/config/pac.m4 @@ -2157,6 +2157,31 @@ CPPFLAGS="$SAVE_CPPFLAGS" +dnl @synopsis PAC_ARG_CUDA +dnl +dnl Test for --enable-cuda +dnl +dnl +dnl +dnl Example use: +dnl +dnl +dnl @author Salvatore Filippone +dnl +AC_DEFUN([PAC_ARG_CUDA], +[AC_MSG_CHECKING([whether we want cuda ]) +AC_ARG_ENABLE(cuda, +AS_HELP_STRING([--enable-cuda], +[Specify whether to enable cuda. ]), +[ +pac_cv_cuda="yes"; +] +dnl , +dnl [pac_cv_cuda="no";] + ) +] +) + dnl @synopsis PAC_CHECK_CUDA dnl @@ -2173,7 +2198,7 @@ dnl dnl @author Salvatore Filippone dnl AC_DEFUN(PAC_CHECK_CUDA, -[AC_ARG_WITH(cuda, AC_HELP_STRING([--with-cuda=DIR], [Specify the CUDA install directory.]), +[AC_ARG_WITH(cudadir, AC_HELP_STRING([--with-cudadir=DIR], [Specify the CUDA install directory.]), [pac_cv_cuda_dir=$withval], [pac_cv_cuda_dir='']) diff --git a/configure b/configure index 3022ff53..dbc419fe 100755 --- a/configure +++ b/configure @@ -849,7 +849,8 @@ with_amd with_amddir with_amdincdir with_amdlibdir -with_cuda +enable_cuda +with_cudadir with_cudacc enable_openacc with_extraopenacc @@ -1506,6 +1507,7 @@ Optional Features: --disable-silent-rules verbose build output (undo: "make V=0") --enable-openmp Specify whether to enable openmp. --disable-openmp do not use OpenMP + --enable-cuda Specify whether to enable cuda. --enable-openacc Specify whether to enable openacc. --disable-openacc do not use Openacc @@ -1550,7 +1552,7 @@ Optional Packages: --with-amddir=DIR Specify the directory for AMD library and includes. --with-amdincdir=DIR Specify the directory for AMD includes. --with-amdlibdir=DIR Specify the directory for AMD library. - --with-cuda=DIR Specify the CUDA install directory. + --with-cudadir=DIR Specify the CUDA install directory. --with-cudacc A comma-separated list of CCs to compile to, for example, --with-cudacc=50,60,70,75 --with-extraopenacc additional [EXTRAOPENACC] flags to be added: will @@ -10628,12 +10630,26 @@ if test "x$psblas_cv_have_amd" == "xyes" ; then fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we want cuda " >&5 +printf %s "checking whether we want cuda ... " >&6; } +# Check whether --enable-cuda was given. +if test ${enable_cuda+y} +then : + enableval=$enable_cuda; +pac_cv_cuda="yes"; + + +fi -# Check whether --with-cuda was given. -if test ${with_cuda+y} + +if test "x$pac_cv_cuda" == "xyes"; then + + +# Check whether --with-cudadir was given. +if test ${with_cudadir+y} then : - withval=$with_cuda; pac_cv_cuda_dir=$withval + withval=$with_cudadir; pac_cv_cuda_dir=$withval else $as_nop pac_cv_cuda_dir='' fi @@ -10719,10 +10735,10 @@ SAVE_LIBS="$LIBS" SAVE_CPPFLAGS="$CPPFLAGS" if test "x$pac_cv_have_cuda" == "x"; then -# Check whether --with-cuda was given. -if test ${with_cuda+y} +# Check whether --with-cudadir was given. +if test ${with_cudadir+y} then : - withval=$with_cuda; pac_cv_cuda_dir=$withval + withval=$with_cudadir; pac_cv_cuda_dir=$withval else $as_nop pac_cv_cuda_dir='' fi @@ -10884,6 +10900,7 @@ fi if test "x$pac_cv_ipk_size" != "x4"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: For CUDA I need psb_ipk_ to be 4 bytes but it is $pac_cv_ipk_size, disabling CUDA/SPGPU" >&5 printf "%s\n" "$as_me: For CUDA I need psb_ipk_ to be 4 bytes but it is $pac_cv_ipk_size, disabling CUDA/SPGPU" >&6;} + pac_cv_cuda="no"; HAVE_CUDA="no"; CUDA_CC=""; SPGPU_LIBS=""; @@ -10893,6 +10910,7 @@ printf "%s\n" "$as_me: For CUDA I need psb_ipk_ to be 4 bytes but it is $pac_cv_ CUDA_INCLUDES=""; CUDA_LIBS=""; fi +fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we want openacc " >&5 printf %s "checking whether we want openacc ... " >&6; } @@ -12741,6 +12759,8 @@ fi OPENACC : ${pac_cv_openacc} FCOPENACC : ${FCOPENACC} + OACCD : ${OACCD} + OACCLD : ${OACCLD} BLAS : ${BLAS_LIBS} @@ -12777,6 +12797,8 @@ printf "%s\n" "$as_me: OPENACC : ${pac_cv_openacc} FCOPENACC : ${FCOPENACC} + OACCD : ${OACCD} + OACCLD : ${OACCLD} BLAS : ${BLAS_LIBS} diff --git a/configure.ac b/configure.ac index c702d4b1..5966801c 100755 --- a/configure.ac +++ b/configure.ac @@ -795,6 +795,8 @@ if test "x$psblas_cv_have_amd" == "xyes" ; then fi +PAC_ARG_CUDA() +if test "x$pac_cv_cuda" == "xyes"; then PAC_CHECK_CUDA() @@ -834,6 +836,7 @@ fi if test "x$pac_cv_ipk_size" != "x4"; then AC_MSG_NOTICE([For CUDA I need psb_ipk_ to be 4 bytes but it is $pac_cv_ipk_size, disabling CUDA/SPGPU]) + pac_cv_cuda="no"; HAVE_CUDA="no"; CUDA_CC=""; SPGPU_LIBS=""; @@ -843,6 +846,7 @@ if test "x$pac_cv_ipk_size" != "x4"; then CUDA_INCLUDES=""; CUDA_LIBS=""; fi +fi PAC_ARG_OPENACC() dnl AC_ARG_ENABLE([openacc],