diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 68edc7a3bf..2e5d1d28e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -185,6 +185,7 @@ set_hypre_option(HIP HYPRE_ENABLE_ROCSOLVER "Use rocSOLVER" ON) set_hypre_option(HIP HYPRE_ENABLE_ROCBLAS "Use rocBLAS" ON) set_hypre_option(HIP HYPRE_ENABLE_ROCRAND "Use rocRAND" ON) set_hypre_option(HIP HYPRE_ENABLE_ROCTHRUST "Use rocThrust" ON) +set_hypre_option(HIP HYPRE_ENABLE_ROCPRIM "Use rocPRIM" ON) # oneAPI options set_hypre_option(SYCL HYPRE_ENABLE_ONEMKLSPARSE "Use oneMKL sparse" ON) set_hypre_option(SYCL HYPRE_ENABLE_ONEMKLBLAS "Use oneMKL blas" ON) diff --git a/src/config/HYPREConfig.cmake.in b/src/config/HYPREConfig.cmake.in index 50010efa8b..bef725134a 100644 --- a/src/config/HYPREConfig.cmake.in +++ b/src/config/HYPREConfig.cmake.in @@ -144,6 +144,8 @@ set(HYPRE_ENABLE_ROCSPARSE @HYPRE_ENABLE_ROCSPARSE@) set(HYPRE_ENABLE_ROCBLAS @HYPRE_ENABLE_ROCBLAS@) set(HYPRE_ENABLE_ROCRAND @HYPRE_ENABLE_ROCRAND@) set(HYPRE_ENABLE_ROCSOLVER @HYPRE_ENABLE_ROCSOLVER@) +set(HYPRE_ENABLE_ROCTHRUST @HYPRE_ENABLE_ROCTHRUST@) +set(HYPRE_ENABLE_ROCPRIM @HYPRE_ENABLE_ROCPRIM@) set(HYPRE_ENABLE_ONEMKLSPARSE @HYPRE_ENABLE_ONEMKLSPARSE@) set(HYPRE_ENABLE_ONEMKLBLAS @HYPRE_ENABLE_ONEMKLBLAS@) set(HYPRE_ENABLE_ONEMKLRAND @HYPRE_ENABLE_ONEMKLRAND@) @@ -243,6 +245,14 @@ if(HYPRE_ENABLE_CUDA OR HYPRE_ENABLE_HIP OR HYPRE_ENABLE_SYCL) if(HYPRE_ENABLE_ROCSOLVER) list(APPEND REQUIRED_GPU_COMPONENTS rocsolver) endif() + + if(HYPRE_ENABLE_ROCTHRUST) + list(APPEND REQUIRED_GPU_COMPONENTS rocthrust) + endif() + + if(HYPRE_ENABLE_ROCPRIM) + list(APPEND REQUIRED_GPU_COMPONENTS rocprim) + endif() elseif(HYPRE_ENABLE_SYCL) if(HYPRE_ENABLE_ONEMKLSPARSE) list(APPEND REQUIRED_GPU_COMPONENTS onemklsparse) diff --git a/src/config/cmake/HYPRE_SetupHIPToolkit.cmake b/src/config/cmake/HYPRE_SetupHIPToolkit.cmake index bbce49c45b..8f43f66d53 100644 --- a/src/config/cmake/HYPRE_SetupHIPToolkit.cmake +++ b/src/config/cmake/HYPRE_SetupHIPToolkit.cmake @@ -222,24 +222,46 @@ function(find_and_add_rocm_library LIB_NAME) set(HYPRE_USING_${LIB_NAME_UPPER} ON CACHE INTERNAL "") find_package(${LIB_NAME} REQUIRED) if(TARGET roc::${LIB_NAME}) - message(STATUS "Found target: ${${LIB_NAME}_LIBRARY}") - if(NOT ${LIB_NAME_UPPER} STREQUAL ROCTHRUST) + message(STATUS "Found target: roc::${LIB_NAME}") + + # Append the library variable that hypre expects. + # Do NOT link rocThrust/rocPRIM targets into Hypre: some external packages export HIP-only + # link flags (e.g., --hip-link/--offload-arch) that would propagate to downstream pure-C++ + # targets and break their link steps. We only need theirinclude dirs. + if (${LIB_NAME_UPPER} STREQUAL ROCTHRUST) + get_target_property(ROCTHRUST_INCLUDE_DIRS roc::rocthrust INTERFACE_INCLUDE_DIRECTORIES) + if(ROCTHRUST_INCLUDE_DIRS) + target_include_directories(${PROJECT_NAME} PUBLIC ${ROCTHRUST_INCLUDE_DIRS}) + message(STATUS "Using rocThrust include dirs: ${ROCTHRUST_INCLUDE_DIRS}") + else() + message(WARNING "roc::rocthrust has no INTERFACE_INCLUDE_DIRECTORIES; relying on ${HIP_PATH}/include for rocThrust headers") + endif() + elseif (${LIB_NAME_UPPER} STREQUAL ROCPRIM) + get_target_property(ROCTHRUST_INCLUDE_DIRS roc::rocprim INTERFACE_INCLUDE_DIRECTORIES) + if(ROCPRIM_INCLUDE_DIRS) + target_include_directories(${PROJECT_NAME} PUBLIC ${ROCPRIM_INCLUDE_DIRS}) + message(STATUS "Using rocPRIM include dirs: ${ROCPRIM_INCLUDE_DIRS}") + else() + message(WARNING "roc::rocprim has no INTERFACE_INCLUDE_DIRECTORIES; relying on ${HIP_PATH}/include for rocPRIM headers") + endif() + else() list(APPEND ROCM_LIBS ${${LIB_NAME}_LIBRARY}) endif() else() - #message(WARNING "roc::${LIB_NAME} target not found. Attempting manual linking.") + message(WARNING "roc::${LIB_NAME} target not found. Attempting manual linking.") find_library(${LIB_NAME}_LIBRARY ${LIB_NAME} HINTS ${HIP_PATH}/lib ${HIP_PATH}/lib64) if(${LIB_NAME}_LIBRARY) message(STATUS "Found ${LIB_NAME} library: ${${LIB_NAME}_LIBRARY}") - if(NOT ${LIB_NAME_UPPER} STREQUAL ROCTHRUST) + if(NOT ${LIB_NAME_UPPER} STREQUAL ROCTHRUST AND NOT ${LIB_NAME_UPPER} STREQUAL ROCPRIM) add_library(roc::${LIB_NAME} UNKNOWN IMPORTED) set_target_properties(roc::${LIB_NAME} PROPERTIES IMPORTED_LOCATION "${${LIB_NAME}_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${HIP_PATH}/include") list(APPEND ROCM_LIBS roc::${LIB_NAME}) else() - set_target_properties(roc::${LIB_NAME} PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${HIP_PATH}/include") + # rocThrust/rocPRIM are header-only; if the package didn't provide a target, fall back + # to the HIP include directory already added below. + message(WARNING "roc::${LIB_NAME} target not found; relying on ${HIP_PATH}/include for rocThrust headers") endif() else() message(FATAL_ERROR "Could not find ${LIB_NAME} library. Please check your ROCm installation.") @@ -255,6 +277,7 @@ find_and_add_rocm_library(rocsparse) find_and_add_rocm_library(rocrand) find_and_add_rocm_library(rocsolver) find_and_add_rocm_library(rocthrust) +find_and_add_rocm_library(rocprim) if(HYPRE_ENABLE_GPU_PROFILING) set(HYPRE_USING_ROCTX ON CACHE BOOL "" FORCE) diff --git a/src/config/configure.in b/src/config/configure.in index 6a90d4b4ae..9a77157968 100644 --- a/src/config/configure.in +++ b/src/config/configure.in @@ -776,7 +776,7 @@ AS_HELP_STRING([--with-MPI-libs=LIBS], --with-MPI-include --with-MPI-libs and --with-MPI-lib-dirs must be used together.]), [for mpi_lib in $withval; do - MPILIBS+=" -l$mpi_lib" + MPILIBS="$MPILIBS -l$mpi_lib" done; hypre_user_chose_mpi=yes] ) @@ -789,7 +789,7 @@ AS_HELP_STRING([--with-MPI-lib-dirs=DIRS], The options --with-MPI-include --with-MPI-libs and --with-MPI-lib-dirs must be used together.]), [for mpi_lib_dir in $withval; do - MPILIBDIRS+=" -L$mpi_lib_dir" + MPILIBDIRS="$MPILIBDIRS -L$mpi_lib_dir" done; hypre_user_chose_mpi=yes] ) @@ -867,7 +867,7 @@ dnl if test $libprefix = "-L" dnl then dnl BLASLIBDIRS="$blas_lib $BLASLIBDIRS" dnl else - BLASLIBS+=" $blas_lib" + BLASLIBS="$BLASLIBS $blas_lib" dnl fi done; hypre_user_chose_blas=yes] @@ -879,7 +879,7 @@ AS_HELP_STRING([--with-blas-libs=LIBS], needed for BLAS (base name only). The options --with-blas-libs and --with-blas-lib-dirs must be used together.]), [for blas_lib in $withval; do - BLASLIBS+=" -l$blas_lib" + BLASLIBS="$BLASLIBS -l$blas_lib" done; hypre_user_chose_blas=yes hypre_blas_lib_old_style=yes] @@ -893,7 +893,7 @@ AS_HELP_STRING([--with-blas-lib-dirs=DIRS], The options --with-blas-libs and --with-blas-lib-dirs must be used together.]), [for blas_lib_dir in $withval; do - BLASLIBDIRS+=" -L$blas_lib_dir" + BLASLIBDIRS="$BLASLIBDIRS -L$blas_lib_dir" done; hypre_user_chose_blas=yes hypre_blas_lib_dir_old_style=yes] @@ -911,7 +911,7 @@ dnl if test $libprefix = "-L" dnl then dnl LAPACKLIBDIRS="$lapack_lib $LAPACKLIBDIRS" dnl else - LAPACKLIBS+=" $lapack_lib" + LAPACKLIBS="$LAPACKLIBS $lapack_lib" dnl fi done; hypre_user_chose_lapack=yes] @@ -923,7 +923,7 @@ AS_HELP_STRING([--with-lapack-libs=LIBS], needed for LAPACK (base name only). The options --with-lapack-libs and --with-lapack-lib-dirs must be used together.]), [for lapack_lib in $withval; do - LAPACKLIBS+=" -l$lapack_lib" + LAPACKLIBS="$LAPACKLIBS -l$lapack_lib" done; hypre_user_chose_lapack=yes hypre_lapack_lib_old_style=yes] @@ -937,7 +937,7 @@ AS_HELP_STRING([--with-lapack-lib-dirs=DIRS], The options --with-lapack-libs and --with-lapack-lib-dirs must be used together.]), [for lapack_lib_dir in $withval; do - LAPACKLIBDIRS+=" -L$lapack_lib_dir" + LAPACKLIBDIRS="$LAPACKLIBDIRS -L$lapack_lib_dir" done; hypre_user_chose_lapack=yes hypre_lapack_lib_dir_old_style=yes] @@ -1085,7 +1085,7 @@ AS_HELP_STRING([--with-superlu-lib=LIBS], [LIBS is space-separated linkable list (enclosed in quotes) of libraries needed for SuperLU. OK to use -L and -l flags in the list]), [for superlu_lib in $withval; do - SUPERLU_LIBS+=" $superlu_lib" + SUPERLU_LIBS="$SUPERLU_LIBS $superlu_lib" done] ) @@ -1117,7 +1117,7 @@ AS_HELP_STRING([--with-dsuperlu-lib=LIBS], [LIBS is space-separated linkable list (enclosed in quotes) of libraries needed for DSuperLU. OK to use -L and -l flags in the list]), [for dsuperlu_lib in $withval; do - DSUPERLU_LIBS+=" $dsuperlu_lib" + DSUPERLU_LIBS="$DSUPERLU_LIBS $dsuperlu_lib" done] ) @@ -1441,7 +1441,7 @@ AS_HELP_STRING([--with-raja-lib=LIBS], [LIBS is space-separated linkable list (enclosed in quotes) of libraries needed for RAJA. OK to use -L and -l flags in the list]), [for raja_lib in $withval; do - HYPRE_RAJA_LIB+=" $raja_lib" + HYPRE_RAJA_LIB="$HYPRE_RAJA_LIB $raja_lib" done; hypre_user_chose_raja=yes] ) @@ -1452,7 +1452,7 @@ AS_HELP_STRING([--with-raja-libs=LIBS], needed for RAJA (base name only). The options --with-raja-libs and --with-raja-lib-dirs must be used together.]), [for raja_lib in $withval; do - HYPRE_RAJA_LIB+=" -l$raja_lib" + HYPRE_RAJA_LIB="$HYPRE_RAJA_LIB -l$raja_lib" done; hypre_user_chose_raja=yes] ) @@ -1465,7 +1465,7 @@ AS_HELP_STRING([--with-raja-lib-dirs=DIRS], The options --with-raja-libs and --raja-blas-lib-dirs must be used together.]), [for raja_lib_dir in $withval; do - HYPRE_RAJA_LIB_DIR+=" -L$raja_lib_dir" + HYPRE_RAJA_LIB_DIR="$HYPRE_RAJA_LIB_DIR -L$raja_lib_dir" done; hypre_user_chose_raja=yes] ) @@ -1499,7 +1499,7 @@ AS_HELP_STRING([--with-kokkos-lib=LIBS], [LIBS is space-separated linkable list (enclosed in quotes) of libraries needed for KOKKOS. OK to use -L and -l flags in the list]), [for kokkos_lib in $withval; do - HYPRE_KOKKOS_LIB+=" $kokkos_lib" + HYPRE_KOKKOS_LIB="$HYPRE_KOKKOS_LIB $kokkos_lib" done; hypre_user_chose_kokkos=yes] ) @@ -1510,7 +1510,7 @@ AS_HELP_STRING([--with-kokkos-libs=LIBS], needed for KOKKOS (base name only). The options --with-kokkos-libs and --with-kokkos-dirs must be used together.]), [for kokkos_lib in $withval; do - HYPRE_KOKKOS_LIB+=" -l$kokkos_lib" + HYPRE_KOKKOS_LIB="$HYPRE_KOKKOS_LIB -l$kokkos_lib" done; hypre_user_chose_kokkos=yes] ) @@ -1523,7 +1523,7 @@ AS_HELP_STRING([--with-kokkos-lib-dirs=DIRS], The options --with-kokkos-libs and --with-kokkos-dirs must be used together.]), [for kokkos_lib_dir in $withval; do - HYPRE_KOKKOS_LIB_DIR+=" -L$kokkos_lib_dir" + HYPRE_KOKKOS_LIB_DIR="$HYPRE_KOKKOS_LIB_DIR -L$kokkos_lib_dir" done; hypre_user_chose_kokkos=yes] ) @@ -1604,7 +1604,7 @@ AS_HELP_STRING([--with-umpire-lib=LIBS], [LIBS is space-separated linkable list (enclosed in quotes) of libraries needed for UMPIRE. OK to use -L and -l flags in the list]), [for umpire_lib in $withval; do - HYPRE_UMPIRE_LIB+=" $umpire_lib" + HYPRE_UMPIRE_LIB="$HYPRE_UMPIRE_LIB $umpire_lib" done; hypre_user_gave_umpire_lib=yes] ) @@ -1615,7 +1615,7 @@ AS_HELP_STRING([--with-umpire-libs=LIBS], needed for UMPIRE (base name only). The options --with-umpire-libs and --with-umpire-dirs must be used together.]), [for umpire_lib in $withval; do - HYPRE_UMPIRE_LIB+=" -l$umpire_lib" + HYPRE_UMPIRE_LIB="$HYPRE_UMPIRE_LIB -l$umpire_lib" done; hypre_user_gave_umpire_libs=yes] ) @@ -1628,8 +1628,8 @@ AS_HELP_STRING([--with-umpire-lib-dirs=DIRS], The options --with-umpire-libs and --with-umpire-dirs must be used together.]), [for umpire_lib_dir in $withval; do - HYPRE_UMPIRE_LIB_DIR+=" -L$umpire_lib_dir" - HYPRE_UMPIRE_RPATH+=" -Wl,-rpath,${umpire_lib_dir}" + HYPRE_UMPIRE_LIB_DIR="$HYPRE_UMPIRE_LIB_DIR -L$umpire_lib_dir" + HYPRE_UMPIRE_RPATH="${HYPRE_UMPIRE_RPATH} -Wl,-rpath,${umpire_lib_dir}" done; hypre_user_gave_umpire_lib_dirs=yes] ) @@ -1667,7 +1667,7 @@ AS_HELP_STRING([--with-magma-lib=LIBS], [LIBS is space-separated linkable list (enclosed in quotes) of libraries needed for MAGMA. OK to use -L and -l flags in the list]), [for magma_lib in $withval; do - HYPRE_MAGMA_LIB+=" $magma_lib" + HYPRE_MAGMA_LIB="$HYPRE_MAGMA_LIB -l$magma_lib" done; hypre_user_gave_magma_lib=yes] ) @@ -1678,7 +1678,7 @@ AS_HELP_STRING([--with-magma-libs=LIBS], needed for MAGMA (base name only). The options --with-magma-libs and --with-magma-lib-dirs must be used together.]), [for magma_lib in $withval; do - HYPRE_MAGMA_LIB+=" -l$magma_lib" + HYPRE_MAGMA_LIB_DIR="$HYPRE_MAGMA_LIB_DIR -L$magma_lib_dir" done; hypre_user_gave_magma_libs=yes] ) @@ -1691,7 +1691,7 @@ AS_HELP_STRING([--with-magma-lib-dirs=DIRS], The options --with-magma-libs and --with-magma-lib-dirs must be used together.]), [for magma_lib_dir in $withval; do - HYPRE_MAGMA_LIB_DIR+=" -L$magma_lib_dir" + HYPRE_MAGMA_LIB_DIR="$HYPRE_MAGMA_LIB_DIR -L$magma_lib_dir" done; hypre_user_gave_magma_lib_dirs=yes] ) @@ -1725,7 +1725,7 @@ AS_HELP_STRING([--with-caliper-lib=LIBS], [LIBS is space-separated linkable list (enclosed in quotes) of libraries needed for Caliper. OK to use -L and -l flags in the list]), [for caliper_lib in $withval; do - CALIPER_LIBS+=" $caliper_lib" + CALIPER_LIBS="$CALIPER_LIBS $caliper_lib" done; hypre_user_gave_caliper_lib=yes] ) @@ -1914,7 +1914,7 @@ if test "$hypre_using_mpi" = "no" then AC_DEFINE(HYPRE_SEQUENTIAL, 1, [Disable MPI, enable serial codes.]) else - AC_HYPRE_CHECK_MPI([LIBS+=" $MPILIBS"]) + AC_HYPRE_CHECK_MPI([LIBS="$LIBS $MPILIBS"]) AC_CHECK_FUNCS([MPI_Comm_f2c]) AC_CACHE_CHECK([whether MPI_Comm_f2c is a macro], hypre_cv_func_MPI_Comm_f2c_macro, @@ -2056,7 +2056,7 @@ then AC_DEFINE(HAVE_MLI, 1, [Define to 1 if using MLI]) fi fi - AC_CHECK_LIB(stdc++, __gxx_personality_v0, LIBS+=" -lstdc++") + AC_CHECK_LIB(stdc++, __gxx_personality_v0, LIBS="$LIBS -lstdc++") else HYPRE_FEI_SRC_DIR= HYPRE_FEI_BASE_DIR= @@ -2132,7 +2132,7 @@ fi dnl ********************************************************************* dnl * FIND libraries needed to link with hypre dnl ********************************************************************* -AC_CHECK_LIB(m, cabs, LIBS+=" -lm") +AC_CHECK_LIB(m, cabs, LIBS="$LIBS -lm") dnl * Commenting this out because it doesn't really behave correctly. dnl * This should probably be deleted altogether at some point. (RDF) dnl AC_HYPRE_FIND_G2C @@ -2880,8 +2880,8 @@ AS_IF([test x"$hypre_using_sycl" == x"yes"], [AC_CHECK_HEADER(["${MKLROOT}/include/mkl.h"], [hypre_found_mkl=yes], AC_MSG_ERROR([unable to find oneMKL ... Ensure that MKLROOT is set])) - HYPRE_SYCL_LIBS+=" -qmkl -Wl,-export-dynamic -Wl,--start-group -Wl,--end-group -lsycl -lOpenCL -lpthread -lm -ldl" - HYPRE_SYCL_INCL+=" -qmkl -I${DPLROOT}/include -DMKL_ILP64 -I${MKLROOT}/include" + HYPRE_SYCL_LIBS="${HYPRE_SYCL_LIBS} -qmkl -Wl,-export-dynamic -Wl,--start-group -Wl,--end-group -lsycl -lOpenCL -lpthread -lm -ldl" + HYPRE_SYCL_INCL="${HYPRE_SYCL_INCL} -qmkl -I${DPLROOT}/include -DMKL_ILP64 -I${MKLROOT}/include" ]) AS_IF([test x"$hypre_using_onemklsparse" == x"yes"], [AC_DEFINE(HYPRE_USING_ONEMKLSPARSE, 1, [onemkl::SPARSE being used])]) diff --git a/src/configure b/src/configure index 5efa731c50..fdb4d04372 100755 --- a/src/configure +++ b/src/configure @@ -4217,7 +4217,7 @@ fi if test ${with_MPI_libs+y} then : withval=$with_MPI_libs; for mpi_lib in $withval; do - MPILIBS+=" -l$mpi_lib" + MPILIBS="$MPILIBS -l$mpi_lib" done; hypre_user_chose_mpi=yes @@ -4229,7 +4229,7 @@ fi if test ${with_MPI_lib_dirs+y} then : withval=$with_MPI_lib_dirs; for mpi_lib_dir in $withval; do - MPILIBDIRS+=" -L$mpi_lib_dir" + MPILIBDIRS="$MPILIBDIRS -L$mpi_lib_dir" done; hypre_user_chose_mpi=yes @@ -4314,7 +4314,7 @@ fi if test ${with_blas_lib+y} then : withval=$with_blas_lib; for blas_lib in $withval; do - BLASLIBS+=" $blas_lib" + BLASLIBS="$BLASLIBS $blas_lib" done; hypre_user_chose_blas=yes @@ -4326,7 +4326,7 @@ fi if test ${with_blas_libs+y} then : withval=$with_blas_libs; for blas_lib in $withval; do - BLASLIBS+=" -l$blas_lib" + BLASLIBS="$BLASLIBS -l$blas_lib" done; hypre_user_chose_blas=yes hypre_blas_lib_old_style=yes @@ -4339,7 +4339,7 @@ fi if test ${with_blas_lib_dirs+y} then : withval=$with_blas_lib_dirs; for blas_lib_dir in $withval; do - BLASLIBDIRS+=" -L$blas_lib_dir" + BLASLIBDIRS="$BLASLIBDIRS -L$blas_lib_dir" done; hypre_user_chose_blas=yes hypre_blas_lib_dir_old_style=yes @@ -4353,7 +4353,7 @@ fi if test ${with_lapack_lib+y} then : withval=$with_lapack_lib; for lapack_lib in $withval; do - LAPACKLIBS+=" $lapack_lib" + LAPACKLIBS="$LAPACKLIBS $lapack_lib" done; hypre_user_chose_lapack=yes @@ -4365,7 +4365,7 @@ fi if test ${with_lapack_libs+y} then : withval=$with_lapack_libs; for lapack_lib in $withval; do - LAPACKLIBS+=" -l$lapack_lib" + LAPACKLIBS="$LAPACKLIBS -l$lapack_lib" done; hypre_user_chose_lapack=yes hypre_lapack_lib_old_style=yes @@ -4378,7 +4378,7 @@ fi if test ${with_lapack_lib_dirs+y} then : withval=$with_lapack_lib_dirs; for lapack_lib_dir in $withval; do - LAPACKLIBDIRS+=" -L$lapack_lib_dir" + LAPACKLIBDIRS="$LAPACKLIBDIRS -L$lapack_lib_dir" done; hypre_user_chose_lapack=yes hypre_lapack_lib_dir_old_style=yes @@ -4550,7 +4550,7 @@ fi if test ${with_superlu_lib+y} then : withval=$with_superlu_lib; for superlu_lib in $withval; do - SUPERLU_LIBS+=" $superlu_lib" + SUPERLU_LIBS="$SUPERLU_LIBS $superlu_lib" done fi @@ -4592,7 +4592,7 @@ fi if test ${with_dsuperlu_lib+y} then : withval=$with_dsuperlu_lib; for dsuperlu_lib in $withval; do - DSUPERLU_LIBS+=" $dsuperlu_lib" + DSUPERLU_LIBS="$DSUPERLU_LIBS $dsuperlu_lib" done fi @@ -4980,7 +4980,7 @@ fi if test ${with_raja_lib+y} then : withval=$with_raja_lib; for raja_lib in $withval; do - HYPRE_RAJA_LIB+=" $raja_lib" + HYPRE_RAJA_LIB="$HYPRE_RAJA_LIB $raja_lib" done; hypre_user_chose_raja=yes @@ -4992,7 +4992,7 @@ fi if test ${with_raja_libs+y} then : withval=$with_raja_libs; for raja_lib in $withval; do - HYPRE_RAJA_LIB+=" -l$raja_lib" + HYPRE_RAJA_LIB="$HYPRE_RAJA_LIB -l$raja_lib" done; hypre_user_chose_raja=yes @@ -5004,7 +5004,7 @@ fi if test ${with_raja_lib_dirs+y} then : withval=$with_raja_lib_dirs; for raja_lib_dir in $withval; do - HYPRE_RAJA_LIB_DIR+=" -L$raja_lib_dir" + HYPRE_RAJA_LIB_DIR="$HYPRE_RAJA_LIB_DIR -L$raja_lib_dir" done; hypre_user_chose_raja=yes @@ -5044,7 +5044,7 @@ fi if test ${with_kokkos_lib+y} then : withval=$with_kokkos_lib; for kokkos_lib in $withval; do - HYPRE_KOKKOS_LIB+=" $kokkos_lib" + HYPRE_KOKKOS_LIB="$HYPRE_KOKKOS_LIB $kokkos_lib" done; hypre_user_chose_kokkos=yes @@ -5056,7 +5056,7 @@ fi if test ${with_kokkos_libs+y} then : withval=$with_kokkos_libs; for kokkos_lib in $withval; do - HYPRE_KOKKOS_LIB+=" -l$kokkos_lib" + HYPRE_KOKKOS_LIB="$HYPRE_KOKKOS_LIB -l$kokkos_lib" done; hypre_user_chose_kokkos=yes @@ -5068,7 +5068,7 @@ fi if test ${with_kokkos_lib_dirs+y} then : withval=$with_kokkos_lib_dirs; for kokkos_lib_dir in $withval; do - HYPRE_KOKKOS_LIB_DIR+=" -L$kokkos_lib_dir" + HYPRE_KOKKOS_LIB_DIR="$HYPRE_KOKKOS_LIB_DIR -L$kokkos_lib_dir" done; hypre_user_chose_kokkos=yes @@ -5167,7 +5167,7 @@ fi if test ${with_umpire_lib+y} then : withval=$with_umpire_lib; for umpire_lib in $withval; do - HYPRE_UMPIRE_LIB+=" $umpire_lib" + HYPRE_UMPIRE_LIB="$HYPRE_UMPIRE_LIB $umpire_lib" done; hypre_user_gave_umpire_lib=yes @@ -5179,7 +5179,7 @@ fi if test ${with_umpire_libs+y} then : withval=$with_umpire_libs; for umpire_lib in $withval; do - HYPRE_UMPIRE_LIB+=" -l$umpire_lib" + HYPRE_UMPIRE_LIB="$HYPRE_UMPIRE_LIB -l$umpire_lib" done; hypre_user_gave_umpire_libs=yes @@ -5191,8 +5191,8 @@ fi if test ${with_umpire_lib_dirs+y} then : withval=$with_umpire_lib_dirs; for umpire_lib_dir in $withval; do - HYPRE_UMPIRE_LIB_DIR+=" -L$umpire_lib_dir" - HYPRE_UMPIRE_RPATH+=" -Wl,-rpath,${umpire_lib_dir}" + HYPRE_UMPIRE_LIB_DIR="$HYPRE_UMPIRE_LIB_DIR -L$umpire_lib_dir" + HYPRE_UMPIRE_RPATH="${HYPRE_UMPIRE_RPATH} -Wl,-rpath,${umpire_lib_dir}" done; hypre_user_gave_umpire_lib_dirs=yes @@ -5239,7 +5239,7 @@ fi if test ${with_magma_lib+y} then : withval=$with_magma_lib; for magma_lib in $withval; do - HYPRE_MAGMA_LIB+=" $magma_lib" + HYPRE_MAGMA_LIB="$HYPRE_MAGMA_LIB -l$magma_lib" done; hypre_user_gave_magma_lib=yes @@ -5251,7 +5251,7 @@ fi if test ${with_magma_libs+y} then : withval=$with_magma_libs; for magma_lib in $withval; do - HYPRE_MAGMA_LIB+=" -l$magma_lib" + HYPRE_MAGMA_LIB_DIR="$HYPRE_MAGMA_LIB_DIR -L$magma_lib_dir" done; hypre_user_gave_magma_libs=yes @@ -5263,7 +5263,7 @@ fi if test ${with_magma_lib_dirs+y} then : withval=$with_magma_lib_dirs; for magma_lib_dir in $withval; do - HYPRE_MAGMA_LIB_DIR+=" -L$magma_lib_dir" + HYPRE_MAGMA_LIB_DIR="$HYPRE_MAGMA_LIB_DIR -L$magma_lib_dir" done; hypre_user_gave_magma_lib_dirs=yes @@ -5308,7 +5308,7 @@ fi if test ${with_caliper_lib+y} then : withval=$with_caliper_lib; for caliper_lib in $withval; do - CALIPER_LIBS+=" $caliper_lib" + CALIPER_LIBS="$CALIPER_LIBS $caliper_lib" done; hypre_user_gave_caliper_lib=yes @@ -8950,7 +8950,7 @@ else printf "%s\n" "#define HYPRE_HAVE_MPI 1" >>confdefs.h - LIBS+=" $MPILIBS" + LIBS="$LIBS $MPILIBS" : fi @@ -9763,7 +9763,7 @@ fi printf "%s\n" "$ac_cv_lib_stdcpp___gxx_personality_v0" >&6; } if test "x$ac_cv_lib_stdcpp___gxx_personality_v0" = xyes then : - LIBS+=" -lstdc++" + LIBS="$LIBS -lstdc++" fi else @@ -10094,7 +10094,7 @@ fi printf "%s\n" "$ac_cv_lib_m_cabs" >&6; } if test "x$ac_cv_lib_m_cabs" = xyes then : - LIBS+=" -lm" + LIBS="$LIBS -lm" fi @@ -11126,8 +11126,8 @@ else $as_nop as_fn_error $? "unable to find oneMKL ... Ensure that MKLROOT is set" "$LINENO" 5 fi - HYPRE_SYCL_LIBS+=" -qmkl -Wl,-export-dynamic -Wl,--start-group -Wl,--end-group -lsycl -lOpenCL -lpthread -lm -ldl" - HYPRE_SYCL_INCL+=" -qmkl -I${DPLROOT}/include -DMKL_ILP64 -I${MKLROOT}/include" + HYPRE_SYCL_LIBS="${HYPRE_SYCL_LIBS} -qmkl -Wl,-export-dynamic -Wl,--start-group -Wl,--end-group -lsycl -lOpenCL -lpthread -lm -ldl" + HYPRE_SYCL_INCL="${HYPRE_SYCL_INCL} -qmkl -I${DPLROOT}/include -DMKL_ILP64 -I${MKLROOT}/include" fi diff --git a/src/parcsr_ls/_hypre_parcsr_ls.h b/src/parcsr_ls/_hypre_parcsr_ls.h index b670ed1b51..3786a66c76 100644 --- a/src/parcsr_ls/_hypre_parcsr_ls.h +++ b/src/parcsr_ls/_hypre_parcsr_ls.h @@ -310,8 +310,8 @@ typedef struct #ifdef HYPRE_USING_DSUPERLU /* Parameters and data for SuperLU_Dist */ - HYPRE_Int dslu_threshold; - HYPRE_Solver dslu_solver; + HYPRE_Int dslu_threshold; + void *dslu_solver; #endif } hypre_ParAMGData; diff --git a/src/parcsr_ls/par_amg.h b/src/parcsr_ls/par_amg.h index ce05da2784..2f3cb10ac9 100644 --- a/src/parcsr_ls/par_amg.h +++ b/src/parcsr_ls/par_amg.h @@ -288,8 +288,8 @@ typedef struct #ifdef HYPRE_USING_DSUPERLU /* Parameters and data for SuperLU_Dist */ - HYPRE_Int dslu_threshold; - HYPRE_Solver dslu_solver; + HYPRE_Int dslu_threshold; + void *dslu_solver; #endif } hypre_ParAMGData; diff --git a/src/parcsr_ls/par_amg_setup.c b/src/parcsr_ls/par_amg_setup.c index 049bc74f1e..1a62f5b6d3 100644 --- a/src/parcsr_ls/par_amg_setup.c +++ b/src/parcsr_ls/par_amg_setup.c @@ -3152,7 +3152,7 @@ hypre_BoomerAMGSetup( void *amg_vdata, (coarse_size > (HYPRE_BigInt)coarse_threshold) && (level != max_levels - 1)) { - HYPRE_Solver dslu_solver = hypre_SLUDistCreate(); + void *dslu_solver = hypre_SLUDistCreate(); hypre_SLUDistSetPrintLevel(dslu_solver, amg_print_level); hypre_SLUDistSetup(dslu_solver, A_array[level], NULL, NULL); hypre_ParAMGDataDSLUSolver(amg_data) = dslu_solver; diff --git a/src/utilities/_hypre_utilities.h b/src/utilities/_hypre_utilities.h index ef127eb3e7..59e7d37246 100644 --- a/src/utilities/_hypre_utilities.h +++ b/src/utilities/_hypre_utilities.h @@ -189,12 +189,6 @@ typedef struct #define hypre_HandleCusparseHandle(hypre_handle) hypre_DeviceDataCusparseHandle(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleVendorSolverHandle(hypre_handle) hypre_DeviceDataVendorSolverHandle(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleComputeStream(hypre_handle) hypre_DeviceDataComputeStream(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubBinGrowth(hypre_handle) hypre_DeviceDataCubBinGrowth(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubMinBin(hypre_handle) hypre_DeviceDataCubMinBin(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubMaxBin(hypre_handle) hypre_DeviceDataCubMaxBin(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubMaxCachedBytes(hypre_handle) hypre_DeviceDataCubMaxCachedBytes(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubDevAllocator(hypre_handle) hypre_DeviceDataCubDevAllocator(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubUvmAllocator(hypre_handle) hypre_DeviceDataCubUvmAllocator(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleDevice(hypre_handle) hypre_DeviceDataDevice(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleDeviceUVM(hypre_handle) hypre_DeviceDataDeviceUVM(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleDeviceMaxWorkGroupSize(hypre_handle) hypre_DeviceDataDeviceMaxWorkGroupSize(hypre_HandleDeviceData(hypre_handle)) @@ -2678,6 +2672,8 @@ first_lsb_bit_indx( hypre_uint x ) x >>= 1; } } +#elif defined(__MINGW32__) + pos = __builtin_ffs((hypre_int) x); #else pos = ffs((hypre_int) x); #endif diff --git a/src/utilities/_hypre_utilities.hpp b/src/utilities/_hypre_utilities.hpp index eb3f2dadc3..741fddb207 100644 --- a/src/utilities/_hypre_utilities.hpp +++ b/src/utilities/_hypre_utilities.hpp @@ -451,6 +451,8 @@ using hypre_DeviceItem = void*; #define HYPRE_THRUST_IDENTITY(type) thrust::identity() #elif defined(HYPRE_USING_CUDA) #define HYPRE_THRUST_IDENTITY(type) cuda::std::identity() +#elif defined(HYPRE_USING_HIP) +#define HYPRE_THRUST_IDENTITY(type) ::internal::identity() #endif using namespace thrust::placeholders; diff --git a/src/utilities/device_utils.h b/src/utilities/device_utils.h index feca41719f..927626bc05 100644 --- a/src/utilities/device_utils.h +++ b/src/utilities/device_utils.h @@ -233,6 +233,8 @@ using hypre_DeviceItem = void*; #define HYPRE_THRUST_IDENTITY(type) thrust::identity() #elif defined(HYPRE_USING_CUDA) #define HYPRE_THRUST_IDENTITY(type) cuda::std::identity() +#elif defined(HYPRE_USING_HIP) +#define HYPRE_THRUST_IDENTITY(type) ::internal::identity() #endif using namespace thrust::placeholders; diff --git a/src/utilities/handle.h b/src/utilities/handle.h index a91e3454e7..c8e172e3a7 100644 --- a/src/utilities/handle.h +++ b/src/utilities/handle.h @@ -96,12 +96,6 @@ typedef struct #define hypre_HandleCusparseHandle(hypre_handle) hypre_DeviceDataCusparseHandle(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleVendorSolverHandle(hypre_handle) hypre_DeviceDataVendorSolverHandle(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleComputeStream(hypre_handle) hypre_DeviceDataComputeStream(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubBinGrowth(hypre_handle) hypre_DeviceDataCubBinGrowth(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubMinBin(hypre_handle) hypre_DeviceDataCubMinBin(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubMaxBin(hypre_handle) hypre_DeviceDataCubMaxBin(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubMaxCachedBytes(hypre_handle) hypre_DeviceDataCubMaxCachedBytes(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubDevAllocator(hypre_handle) hypre_DeviceDataCubDevAllocator(hypre_HandleDeviceData(hypre_handle)) -#define hypre_HandleCubUvmAllocator(hypre_handle) hypre_DeviceDataCubUvmAllocator(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleDevice(hypre_handle) hypre_DeviceDataDevice(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleDeviceUVM(hypre_handle) hypre_DeviceDataDeviceUVM(hypre_HandleDeviceData(hypre_handle)) #define hypre_HandleDeviceMaxWorkGroupSize(hypre_handle) hypre_DeviceDataDeviceMaxWorkGroupSize(hypre_HandleDeviceData(hypre_handle)) diff --git a/src/utilities/hopscotch_hash.h b/src/utilities/hopscotch_hash.h index c8e6918948..1b1b7079c8 100644 --- a/src/utilities/hopscotch_hash.h +++ b/src/utilities/hopscotch_hash.h @@ -145,6 +145,8 @@ first_lsb_bit_indx( hypre_uint x ) x >>= 1; } } +#elif defined(__MINGW32__) + pos = __builtin_ffs((hypre_int) x); #else pos = ffs((hypre_int) x); #endif