diff --git a/build/configure.sh b/build/configure.sh index d079c1250f999ab1ecc7184b9265799183a5f7d0..4e2b9a4094ddf45c3888bffc8c1864fb97b0f37b 100755 --- a/build/configure.sh +++ b/build/configure.sh @@ -16,6 +16,7 @@ LAPACK="auto" LDFLAGS="" LIBMODE="static" MAGMA="auto" +MAGMA_INVERT_FLAGS="" NVTXFLAGS="" OMPMODE="auto" OFFLOAD="auto" @@ -98,6 +99,7 @@ function print_help { echo " than once). " echo "--with-magma=[MAGMA] Use specified MAGMA distribution (DEFAULT). " echo "--without-magma Disable MAGMA. " + echo "--enable-magma-invert=OPTION Use specified MAGMA matrix inversion function (options = auto|getri|gesv|rbt, default getri). " echo " " echo "Some influential environment variables are: " echo " " @@ -162,7 +164,7 @@ do if [ "x$DEBUGFLAGS" = "x" ]; then DEBUGFLAGS=" -DDEBUG_${dbg_feature}" else - DEBUGFLAGS="${DEBUGFLAGS} -DDEBUG_{dbg_feature}" + DEBUGFLAGS="${DEBUGFLAGS} -DDEBUG_${dbg_feature}" fi fi elif [ "x$cut_arg" = "x--enable-fortran" ]; then @@ -220,6 +222,18 @@ do MAGMA_HOME=$(echo $arg | cut -d '=' -f2) elif [ "x$cut_arg" = "x--without-magma" ]; then MAGMA="no" + elif [ "x$cut_arg" = "x--enable-magma-invert" ]; then + MAGMA_INVERT_CHOICE=$(echo $arg | cut -d '=' -f2) + if [ "x$MAGMA_INVERT_CHOICE" = "xgetri" -o "x$MAGMA_INVERT_CHOICE" = "xauto" ]; then + MAGMA_INVERT_FLAGS="" + elif [ "x$MAGMA_INVERT_CHOICE" = "xgesv" ]; then + MAGMA_INVERT_FLAGS=" -DUSE_ZGESV_GPU" + elif [ "x$MAGMA_INVERT_CHOICE" = "xrbt" ]; then + MAGMA_INVERT_FLAGS=" -DUSE_ZGESV_RBT" + else + echo "ERROR: unrecognized --enable-magma-invert option \"$MAGMA_INVERT_CHOICE\"" + exit 1 + fi else echo "ERROR: unrecognized argument \"$arg\"" exit 1 @@ -732,6 +746,11 @@ if [ "x$MAGMA" != "xno" ]; then exit 2 fi else + if [ "x$MAGMAFLAGS" = "x" ]; then + MAGMAFLAGS="$MAGMA_INVERT_FLAGS" + else + MAGMAFLAGS="$MAGMAFLAGS$MAGMA_INVERT_FLAGS" + fi echo "yes" fi else @@ -832,6 +851,13 @@ if [ "x${MAGMAFLAGS}" = "x" ]; then echo "INFO: MAGMA is disabled." else echo "INFO: MAGMA is enabled." + if [ "x${MAGMA_INVERT_FLAGS}" = "x" ]; then + echo "INFO: using LU factorisation for matrix inversion." + elif [ "x${MAGMA_INVERT_FLAGS}" = "x -DUSE_ZGESV_GPU" ]; then + echo "INFO: using MAGMA zgesv_gpu function for matrix inversion." + elif [ "x${MAGMA_INVERT_FLAGS}" = "x -DUSE_ZGESV_RBT" ]; then + echo "INFO: using MAGMA zgesv_rbt function for matrix inversion." + fi fi if [ "x${NVTXFLAGS}" = "x" ]; then echo "INFO: NVTX profiling is disabled."