From 6ce35032611a2776202e8a5ae82c53b0434c692d Mon Sep 17 00:00:00 2001 From: Wayne Mitchell Date: Tue, 21 Feb 2023 22:11:16 +0000 Subject: [PATCH 01/10] Some initial renamings --- src/config/configure.in | 108 +++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 56 deletions(-) diff --git a/src/config/configure.in b/src/config/configure.in index a422247b66..2f236c8de6 100644 --- a/src/config/configure.in +++ b/src/config/configure.in @@ -506,25 +506,25 @@ else fi dnl ********************************************************************* -dnl * Determine if user provided CUDA compiler or flags +dnl * Determine if user provided GPU compiler or flags dnl ********************************************************************* AC_ARG_VAR([CUDA_HOME], [CUDA home directory]) AC_ARG_VAR([HYPRE_CUDA_SM], [CUDA architecture]) -AC_ARG_VAR([CUCC], [CUDA compiler command]) -AC_ARG_VAR([CUFLAGS], [CUDA compiler flags]) +AC_ARG_VAR([GPUCC], [GPU compiler command (e.g. nvcc, hipcc, icpx)]) +AC_ARG_VAR([GPUFLAGS], [GPU compiler flags]) -if test "x$CUCC" = "x" +if test "x$GPUCC" = "x" then - hypre_user_chose_cudacompilers=no + hypre_user_chose_gpucompilers=no else - hypre_user_chose_cudacompilers=yes + hypre_user_chose_gpucompilers=yes fi -if test "x$CUFLAGS" = "x" +if test "x$GPUFLAGS" = "x" then - hypre_user_chose_cuflags=no + hypre_user_chose_gpuflags=no else - hypre_user_chose_cuflags=yes + hypre_user_chose_gpuflags=yes fi dnl ********************************************************************* @@ -605,11 +605,11 @@ AS_HELP_STRING([--with-extra-CXXFLAGS=ARG], [EXTRA_CXXFLAGS=$withval] ) -AC_ARG_WITH(extra-CUFLAGS, -AS_HELP_STRING([--with-extra-CUFLAGS=ARG], - [Define extra CUDA compile flag, where ARG is a space-separated +AC_ARG_WITH(extra-GPUFLAGS, +AS_HELP_STRING([--with-extra-GPUFLAGS=ARG], + [Define extra GPU compile flag, where ARG is a space-separated list (enclosed in quotes) of directories.]), -[EXTRA_CUFLAGS=$withval] +[EXTRA_GPUFLAGS=$withval] ) AC_ARG_WITH(extra-BUILDFLAGS, @@ -1695,7 +1695,7 @@ then fi -if test "$hypre_user_chose_cudacompilers" = "no" +if test "$hypre_user_chose_gpucompilers" = "no" then if test "$hypre_using_device_openmp" = "yes" then @@ -1703,34 +1703,34 @@ then then if test "$hypre_using_mpi" = "no" then - AC_CHECK_PROGS(CUCC, [clang++-gpu icpx]) + AC_CHECK_PROGS(GPUCC, [clang++-gpu icpx]) else - AC_CHECK_PROGS(CUCC, [mpiclang++-gpu mpiicpx]) + AC_CHECK_PROGS(GPUCC, [mpiclang++-gpu mpiicpx]) fi else if test "$hypre_using_mpi" = "no" then - AC_CHECK_PROGS(CUCC, [xlc-gpu clang-gpu icx]) + AC_CHECK_PROGS(GPUCC, [xlc-gpu clang-gpu icx]) else - AC_CHECK_PROGS(CUCC, [mpixlc-gpu mpiclang-gpu mpiicx]) + AC_CHECK_PROGS(GPUCC, [mpixlc-gpu mpiclang-gpu mpiicx]) fi fi fi if test "$hypre_using_cuda" = "yes" then - AC_CHECK_PROGS(CUCC, nvcc, [""], ["${CUDA_HOME}/bin"]) - CUCC="\${HYPRE_CUDA_PATH}/bin/${CUCC} -ccbin=\${CXX}" + AC_CHECK_PROGS(GPUCC, nvcc, [""], ["${CUDA_HOME}/bin"]) + GPUCC="\${HYPRE_CUDA_PATH}/bin/${GPUCC} -ccbin=\${CXX}" fi if test "$hypre_using_hip" = "yes" then - AC_CHECK_PROGS(CUCC, hipcc) + AC_CHECK_PROGS(GPUCC, hipcc) fi if test "$hypre_using_sycl" = "yes" then - AC_CHECK_PROGS(CUCC, icpx) + AC_CHECK_PROGS(GPUCC, icpx) fi fi @@ -2111,7 +2111,7 @@ dnl BUILD_F77_SHARED="${F77} ${SHARED_BUILD_FLAG}" BUILD_CXX_SHARED="\${CXX} ${SHARED_BUILD_FLAG}" if test "$hypre_using_cuda" == "yes" || test "$hypre_using_hip" == "yes" || test "$hypre_using_kokkos" == "yes" then - dnl BUILD_CC_SHARED="\${CUCC} ${SHARED_BUILD_FLAG}" + dnl BUILD_CC_SHARED="\${GPUCC} ${SHARED_BUILD_FLAG}" BUILD_CC_SHARED="\${CXX} ${SHARED_BUILD_FLAG}" fi dnl TODO HIP @@ -2374,8 +2374,8 @@ then LINK_CC=${LINK_CXX} - dnl LINK_CC='${CUCC}' - dnl LINK_CXX='${CUCC}' + dnl LINK_CC='${GPUCC}' + dnl LINK_CXX='${GPUCC}' dnl CUDA SM if test "x$HYPRE_CUDA_SM" = "x" @@ -2388,27 +2388,27 @@ then HYPRE_CUDA_GENCODE="${HYPRE_CUDA_GENCODE}-gencode arch=compute_${sm},code=sm_${sm} " done - if test "$hypre_user_chose_cuflags" = "no" + if test "$hypre_user_chose_gpuflags" = "no" then - CUFLAGS="-lineinfo -expt-extended-lambda -std=c++${hypre_cxxstd} --x cu" + GPUFLAGS="-lineinfo -expt-extended-lambda -std=c++${hypre_cxxstd} --x cu" if test "$hypre_using_debug" = "yes" then - CUFLAGS="-g -O0 ${CUFLAGS}" + GPUFLAGS="-g -O0 ${GPUFLAGS}" else - CUFLAGS="-O2 ${CUFLAGS}" + GPUFLAGS="-O2 ${GPUFLAGS}" fi dnl if [test "${CXX}" = "mpixlC" || test "${CXX}" = "xlC_r" || test "${CXX}" = "xlC"] dnl then - dnl CUFLAGS="${CUFLAGS} -Xcompiler \"-Wno-deprecated-register -Wenum-compare\"" + dnl GPUFLAGS="${GPUFLAGS} -Xcompiler \"-Wno-deprecated-register -Wenum-compare\"" dnl fi - CUFLAGS="${CUFLAGS} -Xcompiler \"${CXXFLAGS}\"" + GPUFLAGS="${GPUFLAGS} -Xcompiler \"${CXXFLAGS}\"" fi dnl if test "$hypre_using_shared" = "yes" dnl then - dnl CUFLAGS="${CUFLAGS} -Xcompiler ${SHARED_COMPILE_FLAG}" + dnl GPUFLAGS="${GPUFLAGS} -Xcompiler ${SHARED_COMPILE_FLAG}" dnl fi dnl CFLAGS=${CXXFLAGS} @@ -2482,12 +2482,11 @@ AS_IF([test x"$hypre_using_hip" == x"yes"], dnl by setting HIPCC_VERBOSE=7 in your environment. dnl AC_CHECK_PROGS(HIPCC, hipcc) - dnl (Ab)Using CUCC when compiling HIP dnl At this time, we need the linker to be hipcc in order to link dnl in device code. LINK_CC=${LINK_CXX} - dnl LINK_CC='${CUCC}' - dnl LINK_CXX='${CUCC}' + dnl LINK_CC='${GPUCC}' + dnl LINK_CXX='${GPUCC}' if test "x${HYPRE_CUDA_SM}" != "x" @@ -2521,11 +2520,10 @@ AS_IF([test x"$hypre_using_hip" == x"yes"], HIPCXXFLAGS="${SHARED_COMPILE_FLAG} ${HIPCXXFLAGS}" fi - dnl (Ab)Use CUFLAGS to capture HIP compilation flags dnl Put HIPCXXFLAGS at the end so the user can override the optimization level. - if test "$hypre_user_chose_cuflags" = "no" + if test "$hypre_user_chose_gpuflags" = "no" then - CUFLAGS="${HIPCPPFLAGS} ${HIPCXXFLAGS}" + GPUFLAGS="${HIPCPPFLAGS} ${HIPCXXFLAGS}" fi dnl PB: ROCm 5.2 parked all the headers in /opt/rocm-X.Y/include so we just point there. @@ -2576,9 +2574,8 @@ AS_IF([test x"$hypre_using_sycl" == x"yes"], AC_DEFINE(HYPRE_USING_GPU, 1, [Define to 1 if executing on GPU device]) AC_DEFINE(HYPRE_USING_SYCL, 1, [SYCL being used]) - dnl (Ab)Using CUCC when compiling SYCL - LINK_CC=${CUCC} - LINK_CXX=${CUCC} + LINK_CC=${GPUCC} + LINK_CXX=${GPUCC} SYCLFLAGS="-fsycl -fsycl-unnamed-lambda" if test "$hypre_using_debug" = "yes" @@ -2600,10 +2597,9 @@ AS_IF([test x"$hypre_using_sycl" == x"yes"], LDFLAGS+=" -Xsycl-target-backend ${HYPRE_SYCL_TARGET_BACKEND}" fi - dnl (Ab)Use CUFLAGS to capture SYCL compilation flags - if test "$hypre_user_chose_cuflags" = "no" + if test "$hypre_user_chose_gpuflags" = "no" then - CUFLAGS="${SYCLFLAGS}" + GPUFLAGS="${SYCLFLAGS}" fi AS_IF([test x"$hypre_using_onemklsparse" == x"yes" || test x"$hypre_using_onemklblas" == x"yes" || test x"$hypre_using_onemklrand" == x"yes"], @@ -2687,23 +2683,23 @@ then dnl AC_DEFINE(HYPRE_DEVICE_OPENMP_MAPPED, 1, [Define to 1 if using OpenMP on device [target mapped version]]) - if test "$hypre_user_chose_cuflags" = "no" + if test "$hypre_user_chose_gpuflags" = "no" then - CUFLAGS="${CXXFLAGS} ${CUFLAGS}" - dnl if [test "$CUCC" = "clang-gpu" || test "$CUCC" = "mpiclang-gpu" || test "$CUCC" = "clang++-gpu" || test "$CUCC" = "mpiclang++-gpu"] + GPUFLAGS="${CXXFLAGS} ${GPUFLAGS}" + dnl if [test "$GPUCC" = "clang-gpu" || test "$GPUCC" = "mpiclang-gpu" || test "$GPUCC" = "clang++-gpu" || test "$GPUCC" = "mpiclang++-gpu"] dnl then # dnl this is too old - #CUFLAGS+=" -fopenmp-nonaliased-maps" + #GPUFLAGS+=" -fopenmp-nonaliased-maps" dnl fi - if [test "$CUCC" = "icx" || test "$CUCC" = "icpx" || test "$CUCC" = "mpiicx" || test "$CUCC" = "mpiicpx"] + if [test "$GPUCC" = "icx" || test "$GPUCC" = "icpx" || test "$GPUCC" = "mpiicx" || test "$GPUCC" = "mpiicpx"] then - CUFLAGS+="-qopenmp -fopenmp-targets=spir64" + GPUFLAGS+="-qopenmp -fopenmp-targets=spir64" fi fi if test "$hypre_user_chose_ldflags" = "no" then - if [test "$CUCC" = "icx" || test "$CUCC" = "icpx" || test "$CUCC" = "mpiicx" || test "$CUCC" = "mpiicpx"] + if [test "$GPUCC" = "icx" || test "$GPUCC" = "icpx" || test "$GPUCC" = "mpiicx" || test "$GPUCC" = "mpiicpx"] then LDFLAGS+="-qopenmp -fopenmp-targets=spir64" fi @@ -2716,8 +2712,8 @@ then dnl let CC be CXX dnl CC=${CXX} - LINK_CC='${CUCC}' - LINK_CXX='${CUCC}' + LINK_CC='${GPUCC}' + LINK_CXX='${GPUCC}' dnl CXXFLAGS="-x c++ ${CXXFLAGS}" dnl CFLAGS=${CXXFLAGS} fi @@ -2742,7 +2738,7 @@ then AC_DEFINE([HYPRE_WITH_GPU_AWARE_MPI],1,[Define to 1 if using GPU aware MPI]) fi -CUFLAGS="${CUFLAGS} ${EXTRA_CUFLAGS}" +GPUFLAGS="${GPUFLAGS} ${EXTRA_GPUFLAGS}" dnl ********************************************************************* dnl * Set installation directories @@ -2878,8 +2874,8 @@ AC_SUBST(HYPRE_UMPIRE_LIB) dnl ********************************************************************* dnl * CUDA stuff dnl ********************************************************************* -AC_SUBST(CUFLAGS) -AC_SUBST(CUCC) +AC_SUBST(GPUFLAGS) +AC_SUBST(GPUCC) AC_SUBST(HYPRE_CUDA_GENCODE) AC_SUBST(HYPRE_CUDA_PATH) AC_SUBST(HYPRE_CUDA_INCLUDE) From 4ffe5954caff2b0a2af09ff0efe2b6cdb7b4a15d Mon Sep 17 00:00:00 2001 From: mitchell82 Date: Mon, 13 Mar 2023 12:58:47 -0700 Subject: [PATCH 02/10] More renamings --- src/config/Makefile.config.in | 18 +-- src/config/configure.in | 73 ++++-------- src/configure | 210 +++++++++++++++++----------------- 3 files changed, 137 insertions(+), 164 deletions(-) diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in index 985ed51302..89e515fbaf 100644 --- a/src/config/Makefile.config.in +++ b/src/config/Makefile.config.in @@ -45,8 +45,8 @@ CFLAGS = @CFLAGS@ @DEFS@ $(C_COMPILE_FLAGS) CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ @DEFS@ $(CXX_COMPILE_FLAGS) -CUCC = @CUCC@ ${CUDA_ARCH} -CUFLAGS = @CUFLAGS@ @DEFS@ ${C_COMPILE_FLAGS} +GPUCC = @GPUCC@ ${GPU_ARCH} +GPUFLAGS = @GPUFLAGS@ @DEFS@ ${C_COMPILE_FLAGS} .f.o: $(FC) $(FFLAGS) -c $< @@ -58,12 +58,12 @@ CUFLAGS = @CUFLAGS@ @DEFS@ ${C_COMPILE_FLAGS} $(CXX) $(CXXFLAGS) -c $< .cc.o: $(CXX) $(CXXFLAGS) -c $< -ifeq ($(CUCC), ) +ifeq ($(GPUCC), ) .c.obj: $(CC) $(CFLAGS) -c $< -o $@ else .c.obj: - $(CUCC) $(CUFLAGS) -c $< -o $@ + $(GPUCC) $(GPUFLAGS) -c $< -o $@ endif LINK_FC = @LINK_FC@ @@ -117,13 +117,17 @@ MPIFLAGS = @MPIFLAGS@ ################################################################## HYPRE_NAP_INCLUDE = @HYPRE_NAP_INCLUDE@ +################################################################## +## GPU architecture +################################################################## +GPU_ARCH = @HYPRE_GPU_GENCODE@ + ################################################################## ## CUDA options ################################################################## HYPRE_CUDA_PATH = @HYPRE_CUDA_PATH@ HYPRE_CUDA_INCLUDE = @HYPRE_CUDA_INCLUDE@ HYPRE_CUDA_LIBS = @HYPRE_CUDA_LIBS@ -CUDA_ARCH = @HYPRE_CUDA_GENCODE@ ################################################################## ## HIP options @@ -134,8 +138,8 @@ HYPRE_HIP_LIBS = @HYPRE_HIP_LIBS@ ################################################################## ## SYCL options ################################################################## -HYPRE_SYCL_INCLUDE=@HYPRE_SYCL_INCL@ -HYPRE_SYCL_LIBS=@HYPRE_SYCL_LIBS@ +HYPRE_SYCL_INCLUDE = @HYPRE_SYCL_INCL@ +HYPRE_SYCL_LIBS = @HYPRE_SYCL_LIBS@ ################################################################## ## Caliper options diff --git a/src/config/configure.in b/src/config/configure.in index c6e6b1ff9b..f645fbcb72 100644 --- a/src/config/configure.in +++ b/src/config/configure.in @@ -509,7 +509,7 @@ dnl ********************************************************************* dnl * Determine if user provided GPU compiler or flags dnl ********************************************************************* AC_ARG_VAR([CUDA_HOME], [CUDA home directory]) -AC_ARG_VAR([HYPRE_CUDA_SM], [CUDA architecture]) +AC_ARG_VAR([GPU_ARCH], [GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)]) AC_ARG_VAR([GPUCC], [GPU compiler command (e.g. nvcc, hipcc, icpx)]) AC_ARG_VAR([GPUFLAGS], [GPU compiler flags]) @@ -1197,14 +1197,14 @@ AS_HELP_STRING([--with-cuda-home=DIR], AC_ARG_WITH(gpu-arch, AS_HELP_STRING([--with-gpu-arch=ARG], - [User specifies NVIDIA GPU architecture that the CUDA files will be compiled for in ARG, where ARG is a space-separated + [User specifies GPU architecture that the device code files will be compiled for in ARG, where ARG is a space-separated list (enclosed in quotes) of numbers.]), [ if test "x${withval}" != "x" then - if test "x${HYPRE_CUDA_SM}" = "x" + if test "x${GPU_ARCH}" = "x" then - HYPRE_CUDA_SM="${withval}" + GPU_ARCH="${withval}" fi fi ] @@ -1283,37 +1283,6 @@ AS_HELP_STRING([--enable-cusolver], dnl ***** SYCL options -AC_ARG_WITH(sycl-target, -AS_HELP_STRING([--with-sycl-target=ARG], - [User specifies sycl targets for AOT compilation in ARG, where ARG is a comma-separated - list (enclosed in quotes), e.g. "spir64_gen".]), -[ - if test "x${withval}" != "x" - then - if test "x${HYPRE_SYCL_TARGET}" = "x" - then - HYPRE_SYCL_TARGET="${withval}" - fi - fi -] -) - -AC_ARG_WITH(sycl-target-backend, -AS_HELP_STRING([--with-sycl-target-backend=ARG], - [User specifies additional options for the sycl target backend for AOT compilation in ARG, - where ARG contains the desired options (enclosed in double+single quotes), - e.g. --with-sycl-target-backend="'-device 12.1.0,12.4.0'".]), -[ - if test "x${withval}" != "x" - then - if test "x${HYPRE_SYCL_TARGET_BACKEND}" = "x" - then - HYPRE_SYCL_TARGET_BACKEND="${withval}" - fi - fi -] -) - AC_ARG_ENABLE(onemklsparse, AS_HELP_STRING([--enable-onemklsparse], [Use oneMKL sparse (default is YES).]), @@ -2378,14 +2347,14 @@ then dnl LINK_CXX='${GPUCC}' dnl CUDA SM - if test "x$HYPRE_CUDA_SM" = "x" + if test "x$GPU_ARCH" = "x" then - HYPRE_CUDA_SM=70 + GPU_ARCH=70 fi - HYPRE_CUDA_GENCODE="" - for sm in ${HYPRE_CUDA_SM}; do - HYPRE_CUDA_GENCODE="${HYPRE_CUDA_GENCODE}-gencode arch=compute_${sm},code=sm_${sm} " + HYPRE_GPU_GENCODE="" + for sm in ${GPU_ARCH}; do + HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}-gencode arch=compute_${sm},code=sm_${sm} " done if test "$hypre_user_chose_gpuflags" = "no" @@ -2489,13 +2458,13 @@ AS_IF([test x"$hypre_using_hip" == x"yes"], dnl LINK_CXX='${GPUCC}' - if test "x${HYPRE_CUDA_SM}" != "x" + if test "x${GPU_ARCH}" != "x" then - HYPRE_CUDA_GENCODE="--amdgpu-target=" - for sm in ${HYPRE_CUDA_SM}; do - HYPRE_CUDA_GENCODE="${HYPRE_CUDA_GENCODE}${sm}," + HYPRE_GPU_GENCODE="--amdgpu-target=" + for sm in ${GPU_ARCH}; do + HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}${sm}," done - HYPRE_CUDA_GENCODE="`echo ${HYPRE_CUDA_GENCODE}|sed 's/,$//'`" + HYPRE_GPU_GENCODE="`echo ${HYPRE_GPU_GENCODE}|sed 's/,$//'`" fi dnl The "-x hip" is necessary to override the detection of .c files which clang @@ -2588,13 +2557,13 @@ AS_IF([test x"$hypre_using_sycl" == x"yes"], LDFLAGS+=" -fsycl -fsycl-device-code-split=per_kernel -Wl,--no-relax" dnl AOT compilation for specific devices - if test "x${HYPRE_SYCL_TARGET}" != "x" + if test "x${GPU_ARCH}" != "x" then - LDFLAGS+=" -fsycl-targets=${HYPRE_SYCL_TARGET}" - fi - if test "x${HYPRE_SYCL_TARGET_BACKEND}" != "x" - then - LDFLAGS+=" -Xsycl-target-backend ${HYPRE_SYCL_TARGET_BACKEND}" + HYPRE_GPU_GENCODE="-fsycl-targets=spir64_gen -Xs '-device '" + for sm in ${GPU_ARCH}; do + HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}${sm}," + done + HYPRE_GPU_GENCODE="`echo ${HYPRE_GPU_GENCODE}|sed 's/,$//'`" fi if test "$hypre_user_chose_gpuflags" = "no" @@ -2876,7 +2845,7 @@ dnl * CUDA stuff dnl ********************************************************************* AC_SUBST(GPUFLAGS) AC_SUBST(GPUCC) -AC_SUBST(HYPRE_CUDA_GENCODE) +AC_SUBST(HYPRE_GPU_GENCODE) AC_SUBST(HYPRE_CUDA_PATH) AC_SUBST(HYPRE_CUDA_INCLUDE) AC_SUBST(HYPRE_CUDA_LIBS) diff --git a/src/configure b/src/configure index 22f6b7188c..71a96113f5 100755 --- a/src/configure +++ b/src/configure @@ -737,8 +737,8 @@ SET_MAKE FC CXX CC -CUFLAGS -CUCC +GPUFLAGS +GPUCC HYPRE_CUDA_SM CUDA_HOME host_os @@ -819,7 +819,7 @@ with_LD with_LDFLAGS with_extra_CFLAGS with_extra_CXXFLAGS -with_extra_CUFLAGS +with_extra_GPUFLAGS with_extra_BUILDFLAGS with_extra_incpath with_extra_ldpath @@ -903,8 +903,8 @@ host_alias target_alias CUDA_HOME HYPRE_CUDA_SM -CUCC -CUFLAGS +GPUCC +GPUFLAGS CC CFLAGS LDFLAGS @@ -1593,8 +1593,8 @@ Optional Packages: Define extra C++ compile flag, where ARG is a space-separated list (enclosed in quotes) of directories. - --with-extra-CUFLAGS=ARG - Define extra CUDA compile flag, where ARG is a + --with-extra-GPUFLAGS=ARG + Define extra GPU compile flag, where ARG is a space-separated list (enclosed in quotes) of directories. --with-extra-BUILDFLAGS=ARG @@ -1795,8 +1795,8 @@ Some influential environment variables: CUDA_HOME CUDA home directory HYPRE_CUDA_SM CUDA architecture - CUCC CUDA compiler command - CUFLAGS CUDA compiler flags + GPUCC GPU compiler command (e.g. nvcc, hipcc, icpx) + GPUFLAGS GPU compiler flags CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a @@ -3766,18 +3766,18 @@ fi -if test "x$CUCC" = "x" +if test "x$GPUCC" = "x" then - hypre_user_chose_cudacompilers=no + hypre_user_chose_gpucompilers=no else - hypre_user_chose_cudacompilers=yes + hypre_user_chose_gpucompilers=yes fi -if test "x$CUFLAGS" = "x" +if test "x$GPUFLAGS" = "x" then - hypre_user_chose_cuflags=no + hypre_user_chose_gpuflags=no else - hypre_user_chose_cuflags=yes + hypre_user_chose_gpuflags=yes fi if test "x$F77" != "x" && test "x$FC" = "x" @@ -3856,10 +3856,10 @@ fi -# Check whether --with-extra-CUFLAGS was given. -if test ${with_extra_CUFLAGS+y} +# Check whether --with-extra-GPUFLAGS was given. +if test ${with_extra_GPUFLAGS+y} then : - withval=$with_extra_CUFLAGS; EXTRA_CUFLAGS=$withval + withval=$with_extra_GPUFLAGS; EXTRA_GPUFLAGS=$withval fi @@ -5775,7 +5775,7 @@ then fi -if test "$hypre_user_chose_cudacompilers" = "no" +if test "$hypre_user_chose_gpucompilers" = "no" then if test "$hypre_using_device_openmp" = "yes" then @@ -5789,12 +5789,12 @@ do set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CUCC+y} +if test ${ac_cv_prog_GPUCC+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CUCC"; then - ac_cv_prog_CUCC="$CUCC" # Let the user override the test. + if test -n "$GPUCC"; then + ac_cv_prog_GPUCC="$GPUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -5807,7 +5807,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CUCC="$ac_prog" + ac_cv_prog_GPUCC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5817,17 +5817,17 @@ IFS=$as_save_IFS fi fi -CUCC=$ac_cv_prog_CUCC -if test -n "$CUCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -printf "%s\n" "$CUCC" >&6; } +GPUCC=$ac_cv_prog_GPUCC +if test -n "$GPUCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPUCC" >&5 +printf "%s\n" "$GPUCC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$CUCC" && break + test -n "$GPUCC" && break done else @@ -5837,12 +5837,12 @@ do set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CUCC+y} +if test ${ac_cv_prog_GPUCC+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CUCC"; then - ac_cv_prog_CUCC="$CUCC" # Let the user override the test. + if test -n "$GPUCC"; then + ac_cv_prog_GPUCC="$GPUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -5855,7 +5855,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CUCC="$ac_prog" + ac_cv_prog_GPUCC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5865,17 +5865,17 @@ IFS=$as_save_IFS fi fi -CUCC=$ac_cv_prog_CUCC -if test -n "$CUCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -printf "%s\n" "$CUCC" >&6; } +GPUCC=$ac_cv_prog_GPUCC +if test -n "$GPUCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPUCC" >&5 +printf "%s\n" "$GPUCC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$CUCC" && break + test -n "$GPUCC" && break done fi @@ -5888,12 +5888,12 @@ do set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CUCC+y} +if test ${ac_cv_prog_GPUCC+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CUCC"; then - ac_cv_prog_CUCC="$CUCC" # Let the user override the test. + if test -n "$GPUCC"; then + ac_cv_prog_GPUCC="$GPUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -5906,7 +5906,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CUCC="$ac_prog" + ac_cv_prog_GPUCC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5916,17 +5916,17 @@ IFS=$as_save_IFS fi fi -CUCC=$ac_cv_prog_CUCC -if test -n "$CUCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -printf "%s\n" "$CUCC" >&6; } +GPUCC=$ac_cv_prog_GPUCC +if test -n "$GPUCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPUCC" >&5 +printf "%s\n" "$GPUCC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$CUCC" && break + test -n "$GPUCC" && break done else @@ -5936,12 +5936,12 @@ do set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CUCC+y} +if test ${ac_cv_prog_GPUCC+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CUCC"; then - ac_cv_prog_CUCC="$CUCC" # Let the user override the test. + if test -n "$GPUCC"; then + ac_cv_prog_GPUCC="$GPUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -5954,7 +5954,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CUCC="$ac_prog" + ac_cv_prog_GPUCC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5964,17 +5964,17 @@ IFS=$as_save_IFS fi fi -CUCC=$ac_cv_prog_CUCC -if test -n "$CUCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -printf "%s\n" "$CUCC" >&6; } +GPUCC=$ac_cv_prog_GPUCC +if test -n "$GPUCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPUCC" >&5 +printf "%s\n" "$GPUCC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$CUCC" && break + test -n "$GPUCC" && break done fi @@ -5989,12 +5989,12 @@ do set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CUCC+y} +if test ${ac_cv_prog_GPUCC+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CUCC"; then - ac_cv_prog_CUCC="$CUCC" # Let the user override the test. + if test -n "$GPUCC"; then + ac_cv_prog_GPUCC="$GPUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in "${CUDA_HOME}/bin" @@ -6007,7 +6007,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CUCC="$ac_prog" + ac_cv_prog_GPUCC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6017,21 +6017,21 @@ IFS=$as_save_IFS fi fi -CUCC=$ac_cv_prog_CUCC -if test -n "$CUCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -printf "%s\n" "$CUCC" >&6; } +GPUCC=$ac_cv_prog_GPUCC +if test -n "$GPUCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPUCC" >&5 +printf "%s\n" "$GPUCC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$CUCC" && break + test -n "$GPUCC" && break done -test -n "$CUCC" || CUCC="""" +test -n "$GPUCC" || GPUCC="""" - CUCC="\${HYPRE_CUDA_PATH}/bin/${CUCC} -ccbin=\${CXX}" + GPUCC="\${HYPRE_CUDA_PATH}/bin/${GPUCC} -ccbin=\${CXX}" fi if test "$hypre_using_hip" = "yes" @@ -6042,12 +6042,12 @@ do set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CUCC+y} +if test ${ac_cv_prog_GPUCC+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CUCC"; then - ac_cv_prog_CUCC="$CUCC" # Let the user override the test. + if test -n "$GPUCC"; then + ac_cv_prog_GPUCC="$GPUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6060,7 +6060,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CUCC="$ac_prog" + ac_cv_prog_GPUCC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6070,17 +6070,17 @@ IFS=$as_save_IFS fi fi -CUCC=$ac_cv_prog_CUCC -if test -n "$CUCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -printf "%s\n" "$CUCC" >&6; } +GPUCC=$ac_cv_prog_GPUCC +if test -n "$GPUCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPUCC" >&5 +printf "%s\n" "$GPUCC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$CUCC" && break + test -n "$GPUCC" && break done fi @@ -6093,12 +6093,12 @@ do set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CUCC+y} +if test ${ac_cv_prog_GPUCC+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CUCC"; then - ac_cv_prog_CUCC="$CUCC" # Let the user override the test. + if test -n "$GPUCC"; then + ac_cv_prog_GPUCC="$GPUCC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6111,7 +6111,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CUCC="$ac_prog" + ac_cv_prog_GPUCC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6121,17 +6121,17 @@ IFS=$as_save_IFS fi fi -CUCC=$ac_cv_prog_CUCC -if test -n "$CUCC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUCC" >&5 -printf "%s\n" "$CUCC" >&6; } +GPUCC=$ac_cv_prog_GPUCC +if test -n "$GPUCC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPUCC" >&5 +printf "%s\n" "$GPUCC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$CUCC" && break + test -n "$GPUCC" && break done fi @@ -10549,18 +10549,18 @@ printf "%s\n" "#define HYPRE_USING_CUDA 1" >>confdefs.h HYPRE_CUDA_GENCODE="${HYPRE_CUDA_GENCODE}-gencode arch=compute_${sm},code=sm_${sm} " done - if test "$hypre_user_chose_cuflags" = "no" + if test "$hypre_user_chose_gpuflags" = "no" then - CUFLAGS="-lineinfo -expt-extended-lambda -std=c++${hypre_cxxstd} --x cu" + GPUFLAGS="-lineinfo -expt-extended-lambda -std=c++${hypre_cxxstd} --x cu" if test "$hypre_using_debug" = "yes" then - CUFLAGS="-g -O0 ${CUFLAGS}" + GPUFLAGS="-g -O0 ${GPUFLAGS}" else - CUFLAGS="-O2 ${CUFLAGS}" + GPUFLAGS="-O2 ${GPUFLAGS}" fi - CUFLAGS="${CUFLAGS} -Xcompiler \"${CXXFLAGS}\"" + GPUFLAGS="${GPUFLAGS} -Xcompiler \"${CXXFLAGS}\"" fi @@ -10649,7 +10649,7 @@ printf "%s\n" "#define HYPRE_USING_HIP 1" >>confdefs.h - LINK_CC=${LINK_CXX} + LINK_CC=${LINK_CXX} if test "x${HYPRE_CUDA_SM}" != "x" @@ -10677,9 +10677,9 @@ fi HIPCXXFLAGS="${SHARED_COMPILE_FLAG} ${HIPCXXFLAGS}" fi - if test "$hypre_user_chose_cuflags" = "no" + if test "$hypre_user_chose_gpuflags" = "no" then - CUFLAGS="${HIPCPPFLAGS} ${HIPCXXFLAGS}" + GPUFLAGS="${HIPCPPFLAGS} ${HIPCXXFLAGS}" fi HYPRE_HIP_INCL="-I${HYPRE_ROCM_PREFIX}/include" @@ -10742,8 +10742,8 @@ printf "%s\n" "#define HYPRE_USING_GPU 1" >>confdefs.h printf "%s\n" "#define HYPRE_USING_SYCL 1" >>confdefs.h - LINK_CC=${CUCC} - LINK_CXX=${CUCC} + LINK_CC=${GPUCC} + LINK_CXX=${GPUCC} SYCLFLAGS="-fsycl -fsycl-unnamed-lambda" if test "$hypre_using_debug" = "yes" @@ -10763,9 +10763,9 @@ printf "%s\n" "#define HYPRE_USING_SYCL 1" >>confdefs.h LDFLAGS+=" -Xsycl-target-backend ${HYPRE_SYCL_TARGET_BACKEND}" fi - if test "$hypre_user_chose_cuflags" = "no" + if test "$hypre_user_chose_gpuflags" = "no" then - CUFLAGS="${SYCLFLAGS}" + GPUFLAGS="${SYCLFLAGS}" fi if test x"$hypre_using_onemklsparse" == x"yes" || test x"$hypre_using_onemklblas" == x"yes" || test x"$hypre_using_onemklrand" == x"yes" @@ -10890,20 +10890,20 @@ printf "%s\n" "#define HYPRE_DEVICE_OPENMP_ALLOC 1" >>confdefs.h - if test "$hypre_user_chose_cuflags" = "no" + if test "$hypre_user_chose_gpuflags" = "no" then - CUFLAGS="${CXXFLAGS} ${CUFLAGS}" + GPUFLAGS="${CXXFLAGS} ${GPUFLAGS}" # dnl this is too old - #CUFLAGS+=" -fopenmp-nonaliased-maps" - if test "$CUCC" = "icx" || test "$CUCC" = "icpx" || test "$CUCC" = "mpiicx" || test "$CUCC" = "mpiicpx" + #GPUFLAGS+=" -fopenmp-nonaliased-maps" + if test "$GPUCC" = "icx" || test "$GPUCC" = "icpx" || test "$GPUCC" = "mpiicx" || test "$GPUCC" = "mpiicpx" then - CUFLAGS+="-qopenmp -fopenmp-targets=spir64" + GPUFLAGS+="-qopenmp -fopenmp-targets=spir64" fi fi if test "$hypre_user_chose_ldflags" = "no" then - if test "$CUCC" = "icx" || test "$CUCC" = "icpx" || test "$CUCC" = "mpiicx" || test "$CUCC" = "mpiicpx" + if test "$GPUCC" = "icx" || test "$GPUCC" = "icpx" || test "$GPUCC" = "mpiicx" || test "$GPUCC" = "mpiicpx" then LDFLAGS+="-qopenmp -fopenmp-targets=spir64" fi @@ -10916,8 +10916,8 @@ printf "%s\n" "#define HYPRE_DEVICE_OPENMP_CHECK 1" >>confdefs.h fi - LINK_CC='${CUCC}' - LINK_CXX='${CUCC}' + LINK_CC='${GPUCC}' + LINK_CXX='${GPUCC}' fi if test "x$hypre_using_um" = "xyes" @@ -10945,7 +10945,7 @@ printf "%s\n" "#define HYPRE_WITH_GPU_AWARE_MPI 1" >>confdefs.h fi -CUFLAGS="${CUFLAGS} ${EXTRA_CUFLAGS}" +GPUFLAGS="${GPUFLAGS} ${EXTRA_GPUFLAGS}" HYPRE_INSTALLDIR="${prefix}" HYPRE_LIBINSTALL="${libdir}" From 5e4d5ccd4523699167cad61a68249349e4af0e4b Mon Sep 17 00:00:00 2001 From: mitchell82 Date: Fri, 17 Mar 2023 12:20:29 -0700 Subject: [PATCH 03/10] Run update --- src/configure | 94 +++++++++++++-------------------------------------- 1 file changed, 24 insertions(+), 70 deletions(-) diff --git a/src/configure b/src/configure index 71a96113f5..e452ae3b89 100755 --- a/src/configure +++ b/src/configure @@ -667,7 +667,7 @@ HYPRE_HIP_INCL HYPRE_CUDA_LIBS HYPRE_CUDA_INCLUDE HYPRE_CUDA_PATH -HYPRE_CUDA_GENCODE +HYPRE_GPU_GENCODE HYPRE_UMPIRE_LIB HYPRE_UMPIRE_INCLUDE HYPRE_UMPIRE_LIB_DIR @@ -739,7 +739,7 @@ CXX CC GPUFLAGS GPUCC -HYPRE_CUDA_SM +GPU_ARCH CUDA_HOME host_os host_vendor @@ -868,8 +868,6 @@ enable_curand enable_cuda_streams enable_cusparse enable_cusolver -with_sycl_target -with_sycl_target_backend enable_onemklsparse enable_onemklblas enable_onemklrand @@ -902,7 +900,7 @@ with_lapack host_alias target_alias CUDA_HOME -HYPRE_CUDA_SM +GPU_ARCH GPUCC GPUFLAGS CC @@ -1704,20 +1702,10 @@ Optional Packages: --with-hip Use HIP for AMD GPUs. (default is NO). --with-sycl Use SYCL for Intel GPUs. (default is NO). --with-cuda-home=DIR User specifies CUDA_HOME in DIR. - --with-gpu-arch=ARG User specifies NVIDIA GPU architecture that the CUDA + --with-gpu-arch=ARG User specifies GPU architecture that the device code files will be compiled for in ARG, where ARG is a space-separated list (enclosed in quotes) of numbers. - --with-sycl-target=ARG User specifies sycl targets for AOT compilation in - ARG, where ARG is a comma-separated list (enclosed - in quotes), e.g. "spir64_gen". - --with-sycl-target-backend=ARG - User specifies additional options for the sycl - target backend for AOT compilation in ARG, where ARG - contains the desired options (enclosed in - double+single quotes), e.g. - --with-sycl-target-backend="'-device - 12.1.0,12.4.0'". --with-raja Use RAJA. Require RAJA package to be compiled properly (default is NO). --with-raja-include=DIR User specifies that RAJA/*.h is in DIR. The options @@ -1793,8 +1781,8 @@ Optional Packages: Some influential environment variables: CUDA_HOME CUDA home directory - HYPRE_CUDA_SM - CUDA architecture + GPU_ARCH GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device + number) GPUCC GPU compiler command (e.g. nvcc, hipcc, icpx) GPUFLAGS GPU compiler flags CC C compiler command @@ -4666,9 +4654,9 @@ then : withval=$with_gpu_arch; if test "x${withval}" != "x" then - if test "x${HYPRE_CUDA_SM}" = "x" + if test "x${GPU_ARCH}" = "x" then - HYPRE_CUDA_SM="${withval}" + GPU_ARCH="${withval}" fi fi @@ -4761,40 +4749,6 @@ fi - -# Check whether --with-sycl-target was given. -if test ${with_sycl_target+y} -then : - withval=$with_sycl_target; - if test "x${withval}" != "x" - then - if test "x${HYPRE_SYCL_TARGET}" = "x" - then - HYPRE_SYCL_TARGET="${withval}" - fi - fi - - -fi - - - -# Check whether --with-sycl-target-backend was given. -if test ${with_sycl_target_backend+y} -then : - withval=$with_sycl_target_backend; - if test "x${withval}" != "x" - then - if test "x${HYPRE_SYCL_TARGET_BACKEND}" = "x" - then - HYPRE_SYCL_TARGET_BACKEND="${withval}" - fi - fi - - -fi - - # Check whether --enable-onemklsparse was given. if test ${enable_onemklsparse+y} then : @@ -10539,14 +10493,14 @@ printf "%s\n" "#define HYPRE_USING_CUDA 1" >>confdefs.h LINK_CC=${LINK_CXX} - if test "x$HYPRE_CUDA_SM" = "x" + if test "x$GPU_ARCH" = "x" then - HYPRE_CUDA_SM=70 + GPU_ARCH=70 fi - HYPRE_CUDA_GENCODE="" - for sm in ${HYPRE_CUDA_SM}; do - HYPRE_CUDA_GENCODE="${HYPRE_CUDA_GENCODE}-gencode arch=compute_${sm},code=sm_${sm} " + HYPRE_GPU_GENCODE="" + for sm in ${GPU_ARCH}; do + HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}-gencode arch=compute_${sm},code=sm_${sm} " done if test "$hypre_user_chose_gpuflags" = "no" @@ -10652,13 +10606,13 @@ printf "%s\n" "#define HYPRE_USING_HIP 1" >>confdefs.h LINK_CC=${LINK_CXX} - if test "x${HYPRE_CUDA_SM}" != "x" + if test "x${GPU_ARCH}" != "x" then - HYPRE_CUDA_GENCODE="--amdgpu-target=" - for sm in ${HYPRE_CUDA_SM}; do - HYPRE_CUDA_GENCODE="${HYPRE_CUDA_GENCODE}${sm}," + HYPRE_GPU_GENCODE="--amdgpu-target=" + for sm in ${GPU_ARCH}; do + HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}${sm}," done - HYPRE_CUDA_GENCODE="`echo ${HYPRE_CUDA_GENCODE}|sed 's/,$//'`" + HYPRE_GPU_GENCODE="`echo ${HYPRE_GPU_GENCODE}|sed 's/,$//'`" fi HIPCXXFLAGS="-x hip -std=c++14 ${HIPCXXFLAGS}" @@ -10754,13 +10708,13 @@ printf "%s\n" "#define HYPRE_USING_SYCL 1" >>confdefs.h fi LDFLAGS+=" -fsycl -fsycl-device-code-split=per_kernel -Wl,--no-relax" - if test "x${HYPRE_SYCL_TARGET}" != "x" + if test "x${GPU_ARCH}" != "x" then - LDFLAGS+=" -fsycl-targets=${HYPRE_SYCL_TARGET}" - fi - if test "x${HYPRE_SYCL_TARGET_BACKEND}" != "x" - then - LDFLAGS+=" -Xsycl-target-backend ${HYPRE_SYCL_TARGET_BACKEND}" + HYPRE_GPU_GENCODE="-fsycl-targets=spir64_gen -Xs '-device '" + for sm in ${GPU_ARCH}; do + HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}${sm}," + done + HYPRE_GPU_GENCODE="`echo ${HYPRE_GPU_GENCODE}|sed 's/,$//'`" fi if test "$hypre_user_chose_gpuflags" = "no" From d1cfad5de9bb694c9e629586c6e7724e0d0a84bc Mon Sep 17 00:00:00 2001 From: Wayne Mitchell Date: Fri, 17 Mar 2023 22:46:55 +0000 Subject: [PATCH 04/10] Update cmake and fix autoconf version for sycl --- src/CMakeLists.txt | 21 ++++++++++----------- src/config/configure.in | 19 ++++++++++++++----- src/configure | 8 +++++--- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f5f4065bae..7e631b3b18 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -117,13 +117,11 @@ option(HYPRE_ENABLE_DEVICE_POOL "Use device memory pool" OFF) option(HYPRE_ENABLE_CUBLAS "Use cuBLAS" OFF) option(HYPRE_ENABLE_CURAND "Use cuRAND" ON) option(HYPRE_ENABLE_GPU_PROFILING "Use NVTX on CUDA" OFF) -set(HYPRE_CUDA_SM "70" CACHE STRING "Target CUDA architecture.") +set(GPU_ARCH "" CACHE STRING "GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)") # oneAPI options option(HYPRE_ENABLE_ONEMKLSPARSE "Use oneMKL sparse" ON) option(HYPRE_ENABLE_ONEMKLBLAS "Use oneMKL blas" ON) option(HYPRE_ENABLE_ONEMKLRAND "Use oneMKL rand" ON) -set(HYPRE_SYCL_TARGET "" CACHE STRING "Target SYCL architecture, e.g. 'spir64_gen'.") -set(HYPRE_SYCL_TARGET_BACKEND "" CACHE STRING "Additional SYCL backend options, e.g. '-device 12.1.0,12.4.0'.") # Umpire resource management options option(HYPRE_WITH_UMPIRE "Use Umpire Allocator for device and unified memory" OFF) option(HYPRE_WITH_UMPIRE_HOST "Use Umpire Allocator for host memory" OFF) @@ -311,12 +309,16 @@ if (HYPRE_WITH_CUDA) set(HYPRE_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) endif () + # Default to cuda sm 70 if not specified + if (!GPU_ARCH) + set(GPU_ARCH ON CACHE BOOL "70" FORCE) + endif () if (CMAKE_VERSION VERSION_LESS 3.18.0) - add_compile_options("$<$:-arch=sm_${HYPRE_CUDA_SM}>") + add_compile_options("$<$:-arch=sm_${GPU_ARCH}>") else () - set(CMAKE_CUDA_ARCHITECTURES "${HYPRE_CUDA_SM}") + set(CMAKE_CUDA_ARCHITECTURES "${GPU_ARCH}") endif () - message(STATUS "Using CUDA architecture: ${HYPRE_CUDA_SM}") + message(STATUS "Using GPU architecture: ${GPU_ARCH}") add_compile_options("$<$:-expt-extended-lambda>") @@ -391,11 +393,8 @@ if (HYPRE_WITH_SYCL) add_link_options("-fsycl-device-code-split=per_kernel") add_link_options("-Wl,--no-relax") - if (HYPRE_SYCL_TARGET) - add_link_options("SHELL:-fsycl-targets=${HYPRE_SYCL_TARGET}") - endif () - if (HYPRE_SYCL_TARGET_BACKEND) - add_link_options("SHELL:-Xsycl-target-backend '${HYPRE_SYCL_TARGET_BACKEND}'") + if (GPU_ARCH) + add_link_options("SHELL:-fsycl-targets=spir64_gen -Xs '-device ${GPU_ARCH}'") endif () set(HYPRE_USING_HOST_MEMORY OFF CACHE BOOL "" FORCE) diff --git a/src/config/configure.in b/src/config/configure.in index c1739e4b9c..1942657538 100644 --- a/src/config/configure.in +++ b/src/config/configure.in @@ -510,6 +510,9 @@ dnl ********************************************************************* dnl * Determine if user provided GPU compiler or flags dnl ********************************************************************* AC_ARG_VAR([CUDA_HOME], [CUDA home directory]) +AC_ARG_VAR([ROCM_PATH], [ROCm home directory]) +AC_ARG_VAR([MKLROOT], [oneMKL home directory]) +AC_ARG_VAR([DPLROOT], [oneDPL home directory]) AC_ARG_VAR([GPU_ARCH], [GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)]) AC_ARG_VAR([GPUCC], [GPU compiler command (e.g. nvcc, hipcc, icpx)]) AC_ARG_VAR([GPUFLAGS], [GPU compiler flags]) @@ -2584,12 +2587,14 @@ AS_IF([test x"$hypre_using_sycl" == x"yes"], dnl AOT compilation for specific devices if test "x${GPU_ARCH}" != "x" then - HYPRE_GPU_GENCODE="-fsycl-targets=spir64_gen -Xs '-device '" - for sm in ${GPU_ARCH}; do - HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}${sm}," + HYPRE_SYCL_TARGET="-fsycl-targets=spir64_gen -Xs '-device " + for dev in ${GPU_ARCH}; do + HYPRE_SYCL_TARGET="${HYPRE_SYCL_TARGET}${dev}," done - HYPRE_GPU_GENCODE="`echo ${HYPRE_GPU_GENCODE}|sed 's/,$//'`" + HYPRE_SYCL_TARGET="`echo ${HYPRE_SYCL_TARGET}|sed 's/,$//'`" + HYPRE_SYCL_TARGET=" ${HYPRE_SYCL_TARGET}'" fi + LDFLAGS+=${HYPRE_SYCL_TARGET} if test "$hypre_user_chose_gpuflags" = "no" then @@ -2866,11 +2871,15 @@ AC_SUBST(HYPRE_UMPIRE_INCLUDE) AC_SUBST(HYPRE_UMPIRE_LIB) dnl ********************************************************************* -dnl * CUDA stuff +dnl * Generic GPU stuff dnl ********************************************************************* AC_SUBST(GPUFLAGS) AC_SUBST(GPUCC) AC_SUBST(HYPRE_GPU_GENCODE) + +dnl ********************************************************************* +dnl * CUDA stuff +dnl ********************************************************************* AC_SUBST(HYPRE_CUDA_PATH) AC_SUBST(HYPRE_CUDA_INCLUDE) AC_SUBST(HYPRE_CUDA_LIBS) diff --git a/src/configure b/src/configure index a7e09c2289..0508f2bf29 100755 --- a/src/configure +++ b/src/configure @@ -10744,12 +10744,14 @@ printf "%s\n" "#define HYPRE_USING_SYCL 1" >>confdefs.h if test "x${GPU_ARCH}" != "x" then - HYPRE_GPU_GENCODE="-fsycl-targets=spir64_gen -Xs '-device '" + HYPRE_SYCL_TARGET="-fsycl-targets=spir64_gen -Xs '-device " for sm in ${GPU_ARCH}; do - HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}${sm}," + HYPRE_SYCL_TARGET="${HYPRE_SYCL_TARGET}${sm}," done - HYPRE_GPU_GENCODE="`echo ${HYPRE_GPU_GENCODE}|sed 's/,$//'`" + HYPRE_SYCL_TARGET="`echo ${HYPRE_SYCL_TARGET}|sed 's/,$//'`" + HYPRE_SYCL_TARGET=" ${HYPRE_SYCL_TARGET}'" fi + LDFLAGS+=${HYPRE_SYCL_TARGET} if test "$hypre_user_chose_gpuflags" = "no" then From e2767abe01bc3f4df47baa75ef1e75480e528172 Mon Sep 17 00:00:00 2001 From: Wayne Bradford Mitchell Date: Tue, 21 Mar 2023 15:17:42 -0700 Subject: [PATCH 05/10] Fix cmake for cuda --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7e631b3b18..d72465dd74 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -310,8 +310,8 @@ if (HYPRE_WITH_CUDA) endif () # Default to cuda sm 70 if not specified - if (!GPU_ARCH) - set(GPU_ARCH ON CACHE BOOL "70" FORCE) + if (GPU_ARCH STREQUAL "") + set(GPU_ARCH "70" CACHE STRING "" FORCE) endif () if (CMAKE_VERSION VERSION_LESS 3.18.0) add_compile_options("$<$:-arch=sm_${GPU_ARCH}>") From 64b974925f30938dd62bc64abd444a954da251e4 Mon Sep 17 00:00:00 2001 From: mitchell82 Date: Tue, 21 Mar 2023 15:50:20 -0700 Subject: [PATCH 06/10] Run update --- src/configure | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/configure b/src/configure index 0508f2bf29..f887b95954 100755 --- a/src/configure +++ b/src/configure @@ -740,6 +740,9 @@ CC GPUFLAGS GPUCC GPU_ARCH +DPLROOT +MKLROOT +ROCM_PATH CUDA_HOME host_os host_vendor @@ -901,6 +904,9 @@ with_lapack host_alias target_alias CUDA_HOME +ROCM_PATH +MKLROOT +DPLROOT GPU_ARCH GPUCC GPUFLAGS @@ -1782,6 +1788,9 @@ Optional Packages: Some influential environment variables: CUDA_HOME CUDA home directory + ROCM_PATH ROCm home directory + MKLROOT oneMKL home directory + DPLROOT oneDPL home directory GPU_ARCH GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number) GPUCC GPU compiler command (e.g. nvcc, hipcc, icpx) @@ -3756,6 +3765,9 @@ fi + + + if test "x$GPUCC" = "x" then hypre_user_chose_gpucompilers=no @@ -10745,8 +10757,8 @@ printf "%s\n" "#define HYPRE_USING_SYCL 1" >>confdefs.h if test "x${GPU_ARCH}" != "x" then HYPRE_SYCL_TARGET="-fsycl-targets=spir64_gen -Xs '-device " - for sm in ${GPU_ARCH}; do - HYPRE_SYCL_TARGET="${HYPRE_SYCL_TARGET}${sm}," + for dev in ${GPU_ARCH}; do + HYPRE_SYCL_TARGET="${HYPRE_SYCL_TARGET}${dev}," done HYPRE_SYCL_TARGET="`echo ${HYPRE_SYCL_TARGET}|sed 's/,$//'`" HYPRE_SYCL_TARGET=" ${HYPRE_SYCL_TARGET}'" @@ -11155,6 +11167,7 @@ printf "%s\n" "#define HYPRE_LINUX 1" >>confdefs.h + ac_config_files="$ac_config_files config/Makefile.config" From cf171eba1c0ff2569bf823bc29f823230aef00a8 Mon Sep 17 00:00:00 2001 From: mitchell82 Date: Tue, 24 Oct 2023 10:39:07 -0700 Subject: [PATCH 07/10] Trying for backward compatibility for autoconf build --- src/config/configure.in | 53 ++++++++++++++++++++++++++++++-- src/configure | 67 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 114 insertions(+), 6 deletions(-) diff --git a/src/config/configure.in b/src/config/configure.in index 80c268255f..566c5610a9 100644 --- a/src/config/configure.in +++ b/src/config/configure.in @@ -539,21 +539,58 @@ AC_ARG_VAR([DPLROOT], [oneDPL home directory]) AC_ARG_VAR([GPU_ARCH], [GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)]) AC_ARG_VAR([GPUCC], [GPU compiler command (e.g. nvcc, hipcc, icpx)]) AC_ARG_VAR([GPUFLAGS], [GPU compiler flags]) +dnl ********************************************************************* +dnl * Legacy variables with cuda naming convention (for backward compatibility) +dnl ********************************************************************* +AC_ARG_VAR([HYPRE_CUDA_SM], [(DEPRECATED: use GPU_ARCH instead) GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)]) +AC_ARG_VAR([CUCC], [(DEPRECATED: use GPUCC instead) GPU compiler command (e.g. nvcc, hipcc, icpx)]) +AC_ARG_VAR([CUFLAGS], [(DEPRECATED: use GPUFLAGS) GPU compiler flags]) if test "x$GPUCC" = "x" then - hypre_user_chose_gpucompilers=no + if test "x$CUCC" = "x" + then + hypre_user_chose_gpucompilers=no + else + hypre_user_chose_gpucompilers=yes + AC_MSG_ERROR([WARNING: use of CUCC variable is deprecated. Use GPUCC instead.]) + GPUCC=$CUCC + fi else + if test "x$CUCC" != "x" + AC_MSG_ERROR([WARNING: use of CUCC variable is deprecated and will be overriden by provided GPUCC.]) + fi hypre_user_chose_gpucompilers=yes fi if test "x$GPUFLAGS" = "x" then - hypre_user_chose_gpuflags=no + if test "x$CUFLAGS" = "x" + then + hypre_user_chose_gpuflags=no + else + hypre_user_chose_gpuflags=yes + AC_MSG_ERROR([WARNING: use of CUFLAGS variable is deprecated. Use GPUFLAGS instead.]) + GPUFLAGS=$CUFLAGS + fi else + if test "x$CUFLAGS" != "x" + AC_MSG_ERROR([WARNING: use of CUFLAGS variable is deprecated and will be overriden by provided GPUFLAGS.]) + fi hypre_user_chose_gpuflags=yes fi +if test "x$HYPRE_CUDA_SM" != "x" +then + if test "x$GPU_ARCH" = "x" + then + AC_MSG_ERROR([WARNING: use of HYPRE_CUDA_SM variable is deprecated. Use GPU_ARCH instead.]) + GPU_ARCH=$HYPRE_CUDA_SM + else + AC_MSG_ERROR([WARNING: use of HYPRE_CUDA_SM variable is deprecated and will be overriden by provided GPU_ARCH.]) + fi +fi + dnl ********************************************************************* dnl * Determine if user provided fortran compiler or flags dnl ********************************************************************* @@ -639,6 +676,16 @@ AS_HELP_STRING([--with-extra-GPUFLAGS=ARG], [EXTRA_GPUFLAGS=$withval] ) +dnl ********************************************************************* +dnl * Legacy configure option with cuda naming convention (for backward compatibility) +dnl ********************************************************************* +AC_ARG_WITH(extra-CUFLAGS, +AS_HELP_STRING([--with-extra-CUFLAGS=ARG], + [(DEPRECATED: use --with-extra-GPUFLAGS instead) Define extra GPU compile flag, + where ARG is a space-separated list (enclosed in quotes) of directories.]), +[EXTRA_CUFLAGS=$withval] +) + AC_ARG_WITH(extra-BUILDFLAGS, AS_HELP_STRING([--with-extra-BUILDFLAGS=ARG], [Define extra library build flag, where ARG is a space-separated @@ -2869,7 +2916,7 @@ then AC_DEFINE([HYPRE_WITH_GPU_AWARE_MPI],1,[Define to 1 if using GPU aware MPI]) fi -GPUFLAGS="${GPUFLAGS} ${EXTRA_GPUFLAGS}" +GPUFLAGS="${GPUFLAGS} ${EXTRA_GPUFLAGS} ${EXTRA_CUFLAGS}" dnl ********************************************************************* dnl * Set installation directories diff --git a/src/configure b/src/configure index 01fd4678cc..99d1465aed 100755 --- a/src/configure +++ b/src/configure @@ -740,6 +740,9 @@ SET_MAKE FC CXX CC +CUFLAGS +CUCC +HYPRE_CUDA_SM GPUFLAGS GPUCC GPU_ARCH @@ -827,6 +830,7 @@ with_LDFLAGS with_extra_CFLAGS with_extra_CXXFLAGS with_extra_GPUFLAGS +with_extra_CUFLAGS with_extra_BUILDFLAGS with_extra_incpath with_extra_ldpath @@ -919,6 +923,9 @@ DPLROOT GPU_ARCH GPUCC GPUFLAGS +HYPRE_CUDA_SM +CUCC +CUFLAGS CC CFLAGS LDFLAGS @@ -1612,6 +1619,11 @@ Optional Packages: Define extra GPU compile flag, where ARG is a space-separated list (enclosed in quotes) of directories. + --with-extra-CUFLAGS=ARG + (DEPRECATED: use --with-extra-GPUFLAGS instead) + Define extra GPU compile flag, where ARG is a + space-separated list (enclosed in quotes) of + directories. --with-extra-BUILDFLAGS=ARG Define extra library build flag, where ARG is a space-separated list (enclosed in quotes) of @@ -1824,6 +1836,12 @@ Some influential environment variables: number) GPUCC GPU compiler command (e.g. nvcc, hipcc, icpx) GPUFLAGS GPU compiler flags + HYPRE_CUDA_SM + (DEPRECATED: use GPU_ARCH instead) GPU architecture (e.g. + CUDA/HIP SM number or Intel GPU device number) + CUCC (DEPRECATED: use GPUCC instead) GPU compiler command (e.g. nvcc, + hipcc, icpx) + CUFLAGS (DEPRECATED: use GPUFLAGS) GPU compiler flags CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a @@ -3822,20 +3840,54 @@ fi + + + if test "x$GPUCC" = "x" then - hypre_user_chose_gpucompilers=no + if test "x$CUCC" = "x" + then + hypre_user_chose_gpucompilers=no + else + hypre_user_chose_gpucompilers=yes + as_fn_error $? "WARNING: use of CUCC variable is deprecated. Use GPUCC instead." "$LINENO" 5 + GPUCC=$CUCC + fi else + if test "x$CUCC" != "x" + as_fn_error $? "WARNING: use of CUCC variable is deprecated and will be overriden by provided GPUCC." "$LINENO" 5 + fi hypre_user_chose_gpucompilers=yes fi if test "x$GPUFLAGS" = "x" then - hypre_user_chose_gpuflags=no + if test "x$CUFLAGS" = "x" + then + hypre_user_chose_gpuflags=no + else + hypre_user_chose_gpuflags=yes + as_fn_error $? "WARNING: use of CUFLAGS variable is deprecated. Use GPUFLAGS instead." "$LINENO" 5 + GPUFLAGS=$CUFLAGS + fi else + if test "x$CUFLAGS" != "x" + as_fn_error $? "WARNING: use of CUFLAGS variable is deprecated and will be overriden by provided GPUFLAGS." "$LINENO" 5 + fi hypre_user_chose_gpuflags=yes fi +if test "x$HYPRE_CUDA_SM" != "x" +then + if test "x$GPU_ARCH" = "x" + then + as_fn_error $? "WARNING: use of HYPRE_CUDA_SM variable is deprecated. Use GPU_ARCH instead." "$LINENO" 5 + GPU_ARCH=$HYPRE_CUDA_SM + else + as_fn_error $? "WARNING: use of HYPRE_CUDA_SM variable is deprecated and will be overriden by provided GPU_ARCH." "$LINENO" 5 + fi +fi + if test "x$F77" != "x" && test "x$FC" = "x" then FC="$F77" @@ -3921,6 +3973,15 @@ fi +# Check whether --with-extra-CUFLAGS was given. +if test ${with_extra_CUFLAGS+y} +then : + withval=$with_extra_CUFLAGS; EXTRA_CUFLAGS=$withval + +fi + + + # Check whether --with-extra-BUILDFLAGS was given. if test ${with_extra_BUILDFLAGS+y} then : @@ -11126,7 +11187,7 @@ printf "%s\n" "#define HYPRE_WITH_GPU_AWARE_MPI 1" >>confdefs.h fi -GPUFLAGS="${GPUFLAGS} ${EXTRA_GPUFLAGS}" +GPUFLAGS="${GPUFLAGS} ${EXTRA_GPUFLAGS} ${EXTRA_CUFLAGS}" HYPRE_INSTALLDIR="${prefix}" HYPRE_LIBINSTALL="${libdir}" From b8336ebf1a5e103915076d0d2d568672ab9bd3af Mon Sep 17 00:00:00 2001 From: mitchell82 Date: Tue, 24 Oct 2023 10:44:12 -0700 Subject: [PATCH 08/10] Backwards compatibility for cmake build --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 69dc0b0dbf..e302d7df39 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -122,6 +122,7 @@ option(HYPRE_ENABLE_CUBLAS "Use cuBLAS" OFF) option(HYPRE_ENABLE_CURAND "Use cuRAND" ON) option(HYPRE_ENABLE_GPU_PROFILING "Use NVTX on CUDA" OFF) set(GPU_ARCH "" CACHE STRING "GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)") +set(HYPRE_CUDA_SM "70" CACHE STRING "(DEPRECATED: use GPU_ARCH instead) Target CUDA architecture.") # oneAPI options option(HYPRE_ENABLE_ONEMKLSPARSE "Use oneMKL sparse" ON) option(HYPRE_ENABLE_ONEMKLBLAS "Use oneMKL blas" ON) From 4d610b815d8d1c3c259f578267bea6cce67a0ec4 Mon Sep 17 00:00:00 2001 From: mitchell82 Date: Tue, 24 Oct 2023 10:45:55 -0700 Subject: [PATCH 09/10] Update GPU_ARCH to HYPRE_GPU_ARCH --- src/config/Makefile.config.in | 4 ++-- src/config/configure.in | 30 +++++++++++++++--------------- src/configure | 35 ++++++++++++++++++----------------- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in index 1d274da178..92cdbcd981 100644 --- a/src/config/Makefile.config.in +++ b/src/config/Makefile.config.in @@ -45,7 +45,7 @@ CFLAGS = @CFLAGS@ @DEFS@ $(C_COMPILE_FLAGS) CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ @DEFS@ $(CXX_COMPILE_FLAGS) -GPUCC = @GPUCC@ ${GPU_ARCH} +GPUCC = @GPUCC@ ${HYPRE_GPU_ARCH} GPUFLAGS = @GPUFLAGS@ @DEFS@ ${C_COMPILE_FLAGS} .f.o: @@ -120,7 +120,7 @@ HYPRE_NAP_INCLUDE = @HYPRE_NAP_INCLUDE@ ################################################################## ## GPU architecture ################################################################## -GPU_ARCH = @HYPRE_GPU_GENCODE@ +HYPRE_GPU_ARCH = @HYPRE_GPU_GENCODE@ ################################################################## ## CUDA options diff --git a/src/config/configure.in b/src/config/configure.in index 566c5610a9..b723a8bd7c 100644 --- a/src/config/configure.in +++ b/src/config/configure.in @@ -536,13 +536,13 @@ AC_ARG_VAR([CUDA_HOME], [CUDA home directory]) AC_ARG_VAR([ROCM_PATH], [ROCm home directory]) AC_ARG_VAR([MKLROOT], [oneMKL home directory]) AC_ARG_VAR([DPLROOT], [oneDPL home directory]) -AC_ARG_VAR([GPU_ARCH], [GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)]) +AC_ARG_VAR([HYPRE_GPU_ARCH], [GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)]) AC_ARG_VAR([GPUCC], [GPU compiler command (e.g. nvcc, hipcc, icpx)]) AC_ARG_VAR([GPUFLAGS], [GPU compiler flags]) dnl ********************************************************************* dnl * Legacy variables with cuda naming convention (for backward compatibility) dnl ********************************************************************* -AC_ARG_VAR([HYPRE_CUDA_SM], [(DEPRECATED: use GPU_ARCH instead) GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)]) +AC_ARG_VAR([HYPRE_CUDA_SM], [(DEPRECATED: use HYPRE_GPU_ARCH instead) GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)]) AC_ARG_VAR([CUCC], [(DEPRECATED: use GPUCC instead) GPU compiler command (e.g. nvcc, hipcc, icpx)]) AC_ARG_VAR([CUFLAGS], [(DEPRECATED: use GPUFLAGS) GPU compiler flags]) @@ -582,12 +582,12 @@ fi if test "x$HYPRE_CUDA_SM" != "x" then - if test "x$GPU_ARCH" = "x" + if test "x$HYPRE_GPU_ARCH" = "x" then - AC_MSG_ERROR([WARNING: use of HYPRE_CUDA_SM variable is deprecated. Use GPU_ARCH instead.]) - GPU_ARCH=$HYPRE_CUDA_SM + AC_MSG_ERROR([WARNING: use of HYPRE_CUDA_SM variable is deprecated. Use HYPRE_GPU_ARCH instead.]) + HYPRE_GPU_ARCH=$HYPRE_CUDA_SM else - AC_MSG_ERROR([WARNING: use of HYPRE_CUDA_SM variable is deprecated and will be overriden by provided GPU_ARCH.]) + AC_MSG_ERROR([WARNING: use of HYPRE_CUDA_SM variable is deprecated and will be overriden by provided HYPRE_GPU_ARCH.]) fi fi @@ -1295,9 +1295,9 @@ AS_HELP_STRING([--with-gpu-arch=ARG], [ if test "x${withval}" != "x" then - if test "x${GPU_ARCH}" = "x" + if test "x${HYPRE_GPU_ARCH}" = "x" then - GPU_ARCH="${withval}" + HYPRE_GPU_ARCH="${withval}" fi fi ] @@ -2546,13 +2546,13 @@ then dnl LINK_CXX='${GPUCC}' dnl CUDA SM - if test "x$GPU_ARCH" = "x" + if test "x$HYPRE_GPU_ARCH" = "x" then - GPU_ARCH=70 + HYPRE_GPU_ARCH=70 fi HYPRE_GPU_GENCODE="" - for sm in ${GPU_ARCH}; do + for sm in ${HYPRE_GPU_ARCH}; do HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}-gencode arch=compute_${sm},code=sm_${sm} " done @@ -2662,10 +2662,10 @@ AS_IF([test x"$hypre_using_hip" == x"yes"], dnl LINK_CXX='${GPUCC}' - if test "x${GPU_ARCH}" != "x" + if test "x${HYPRE_GPU_ARCH}" != "x" then HYPRE_GPU_GENCODE="--amdgpu-target=" - for sm in ${GPU_ARCH}; do + for sm in ${HYPRE_GPU_ARCH}; do HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}${sm}," done HYPRE_GPU_GENCODE="`echo ${HYPRE_GPU_GENCODE}|sed 's/,$//'`" @@ -2766,10 +2766,10 @@ AS_IF([test x"$hypre_using_sycl" == x"yes"], LDFLAGS+=" -fsycl -fsycl-device-code-split=per_kernel -Wl,--no-relax" dnl AOT compilation for specific devices - if test "x${GPU_ARCH}" != "x" + if test "x${HYPRE_GPU_ARCH}" != "x" then HYPRE_SYCL_TARGET="-fsycl-targets=spir64_gen -Xs '-device " - for dev in ${GPU_ARCH}; do + for dev in ${HYPRE_GPU_ARCH}; do HYPRE_SYCL_TARGET="${HYPRE_SYCL_TARGET}${dev}," done HYPRE_SYCL_TARGET="`echo ${HYPRE_SYCL_TARGET}|sed 's/,$//'`" diff --git a/src/configure b/src/configure index 99d1465aed..11e01cd496 100755 --- a/src/configure +++ b/src/configure @@ -745,7 +745,7 @@ CUCC HYPRE_CUDA_SM GPUFLAGS GPUCC -GPU_ARCH +HYPRE_GPU_ARCH DPLROOT MKLROOT ROCM_PATH @@ -920,7 +920,7 @@ CUDA_HOME ROCM_PATH MKLROOT DPLROOT -GPU_ARCH +HYPRE_GPU_ARCH GPUCC GPUFLAGS HYPRE_CUDA_SM @@ -1832,12 +1832,13 @@ Some influential environment variables: ROCM_PATH ROCm home directory MKLROOT oneMKL home directory DPLROOT oneDPL home directory - GPU_ARCH GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device + HYPRE_GPU_ARCH + GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number) GPUCC GPU compiler command (e.g. nvcc, hipcc, icpx) GPUFLAGS GPU compiler flags HYPRE_CUDA_SM - (DEPRECATED: use GPU_ARCH instead) GPU architecture (e.g. + (DEPRECATED: use HYPRE_GPU_ARCH instead) GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number) CUCC (DEPRECATED: use GPUCC instead) GPU compiler command (e.g. nvcc, hipcc, icpx) @@ -3879,12 +3880,12 @@ fi if test "x$HYPRE_CUDA_SM" != "x" then - if test "x$GPU_ARCH" = "x" + if test "x$HYPRE_GPU_ARCH" = "x" then - as_fn_error $? "WARNING: use of HYPRE_CUDA_SM variable is deprecated. Use GPU_ARCH instead." "$LINENO" 5 - GPU_ARCH=$HYPRE_CUDA_SM + as_fn_error $? "WARNING: use of HYPRE_CUDA_SM variable is deprecated. Use HYPRE_GPU_ARCH instead." "$LINENO" 5 + HYPRE_GPU_ARCH=$HYPRE_CUDA_SM else - as_fn_error $? "WARNING: use of HYPRE_CUDA_SM variable is deprecated and will be overriden by provided GPU_ARCH." "$LINENO" 5 + as_fn_error $? "WARNING: use of HYPRE_CUDA_SM variable is deprecated and will be overriden by provided HYPRE_GPU_ARCH." "$LINENO" 5 fi fi @@ -4805,9 +4806,9 @@ then : withval=$with_gpu_arch; if test "x${withval}" != "x" then - if test "x${GPU_ARCH}" = "x" + if test "x${HYPRE_GPU_ARCH}" = "x" then - GPU_ARCH="${withval}" + HYPRE_GPU_ARCH="${withval}" fi fi @@ -10766,13 +10767,13 @@ printf "%s\n" "#define HYPRE_USING_CUDA 1" >>confdefs.h LINK_CC=${LINK_CXX} - if test "x$GPU_ARCH" = "x" + if test "x$HYPRE_GPU_ARCH" = "x" then - GPU_ARCH=70 + HYPRE_GPU_ARCH=70 fi HYPRE_GPU_GENCODE="" - for sm in ${GPU_ARCH}; do + for sm in ${HYPRE_GPU_ARCH}; do HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}-gencode arch=compute_${sm},code=sm_${sm} " done @@ -10886,10 +10887,10 @@ printf "%s\n" "#define HYPRE_USING_HIP 1" >>confdefs.h LINK_CC=${LINK_CXX} - if test "x${GPU_ARCH}" != "x" + if test "x${HYPRE_GPU_ARCH}" != "x" then HYPRE_GPU_GENCODE="--amdgpu-target=" - for sm in ${GPU_ARCH}; do + for sm in ${HYPRE_GPU_ARCH}; do HYPRE_GPU_GENCODE="${HYPRE_GPU_GENCODE}${sm}," done HYPRE_GPU_GENCODE="`echo ${HYPRE_GPU_GENCODE}|sed 's/,$//'`" @@ -10998,10 +10999,10 @@ printf "%s\n" "#define HYPRE_USING_SYCL 1" >>confdefs.h fi LDFLAGS+=" -fsycl -fsycl-device-code-split=per_kernel -Wl,--no-relax" - if test "x${GPU_ARCH}" != "x" + if test "x${HYPRE_GPU_ARCH}" != "x" then HYPRE_SYCL_TARGET="-fsycl-targets=spir64_gen -Xs '-device " - for dev in ${GPU_ARCH}; do + for dev in ${HYPRE_GPU_ARCH}; do HYPRE_SYCL_TARGET="${HYPRE_SYCL_TARGET}${dev}," done HYPRE_SYCL_TARGET="`echo ${HYPRE_SYCL_TARGET}|sed 's/,$//'`" From e982f822c6edcd6f643b4629c1d6583ab7a40bdb Mon Sep 17 00:00:00 2001 From: mitchell82 Date: Tue, 24 Oct 2023 11:15:56 -0700 Subject: [PATCH 10/10] Fix syntax error --- src/config/configure.in | 2 ++ src/configure | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/config/configure.in b/src/config/configure.in index b723a8bd7c..7e2c6b9193 100644 --- a/src/config/configure.in +++ b/src/config/configure.in @@ -558,6 +558,7 @@ then fi else if test "x$CUCC" != "x" + then AC_MSG_ERROR([WARNING: use of CUCC variable is deprecated and will be overriden by provided GPUCC.]) fi hypre_user_chose_gpucompilers=yes @@ -575,6 +576,7 @@ then fi else if test "x$CUFLAGS" != "x" + then AC_MSG_ERROR([WARNING: use of CUFLAGS variable is deprecated and will be overriden by provided GPUFLAGS.]) fi hypre_user_chose_gpuflags=yes diff --git a/src/configure b/src/configure index 11e01cd496..df679835b5 100755 --- a/src/configure +++ b/src/configure @@ -3856,6 +3856,7 @@ then fi else if test "x$CUCC" != "x" + then as_fn_error $? "WARNING: use of CUCC variable is deprecated and will be overriden by provided GPUCC." "$LINENO" 5 fi hypre_user_chose_gpucompilers=yes @@ -3873,6 +3874,7 @@ then fi else if test "x$CUFLAGS" != "x" + then as_fn_error $? "WARNING: use of CUFLAGS variable is deprecated and will be overriden by provided GPUFLAGS." "$LINENO" 5 fi hypre_user_chose_gpuflags=yes