Skip to content
Snippets Groups Projects
Commit 7fb824a5 authored by Mulas, Giacomo's avatar Mulas, Giacomo
Browse files

add support for alternative magma inversion routines and fix more than one debug option

parent 1487499d
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ LAPACK="auto" ...@@ -16,6 +16,7 @@ LAPACK="auto"
LDFLAGS="" LDFLAGS=""
LIBMODE="static" LIBMODE="static"
MAGMA="auto" MAGMA="auto"
MAGMA_INVERT_FLAGS=""
NVTXFLAGS="" NVTXFLAGS=""
OMPMODE="auto" OMPMODE="auto"
OFFLOAD="auto" OFFLOAD="auto"
...@@ -98,6 +99,7 @@ function print_help { ...@@ -98,6 +99,7 @@ function print_help {
echo " than once). " echo " than once). "
echo "--with-magma=[MAGMA] Use specified MAGMA distribution (DEFAULT). " echo "--with-magma=[MAGMA] Use specified MAGMA distribution (DEFAULT). "
echo "--without-magma Disable MAGMA. " 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 " "
echo "Some influential environment variables are: " echo "Some influential environment variables are: "
echo " " echo " "
...@@ -162,7 +164,7 @@ do ...@@ -162,7 +164,7 @@ do
if [ "x$DEBUGFLAGS" = "x" ]; then if [ "x$DEBUGFLAGS" = "x" ]; then
DEBUGFLAGS=" -DDEBUG_${dbg_feature}" DEBUGFLAGS=" -DDEBUG_${dbg_feature}"
else else
DEBUGFLAGS="${DEBUGFLAGS} -DDEBUG_{dbg_feature}" DEBUGFLAGS="${DEBUGFLAGS} -DDEBUG_${dbg_feature}"
fi fi
fi fi
elif [ "x$cut_arg" = "x--enable-fortran" ]; then elif [ "x$cut_arg" = "x--enable-fortran" ]; then
...@@ -220,6 +222,18 @@ do ...@@ -220,6 +222,18 @@ do
MAGMA_HOME=$(echo $arg | cut -d '=' -f2) MAGMA_HOME=$(echo $arg | cut -d '=' -f2)
elif [ "x$cut_arg" = "x--without-magma" ]; then elif [ "x$cut_arg" = "x--without-magma" ]; then
MAGMA="no" 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 else
echo "ERROR: unrecognized argument \"$arg\"" echo "ERROR: unrecognized argument \"$arg\""
exit 1 exit 1
...@@ -732,6 +746,11 @@ if [ "x$MAGMA" != "xno" ]; then ...@@ -732,6 +746,11 @@ if [ "x$MAGMA" != "xno" ]; then
exit 2 exit 2
fi fi
else else
if [ "x$MAGMAFLAGS" = "x" ]; then
MAGMAFLAGS="$MAGMA_INVERT_FLAGS"
else
MAGMAFLAGS="$MAGMAFLAGS$MAGMA_INVERT_FLAGS"
fi
echo "yes" echo "yes"
fi fi
else else
...@@ -832,6 +851,13 @@ if [ "x${MAGMAFLAGS}" = "x" ]; then ...@@ -832,6 +851,13 @@ if [ "x${MAGMAFLAGS}" = "x" ]; then
echo "INFO: MAGMA is disabled." echo "INFO: MAGMA is disabled."
else else
echo "INFO: MAGMA is enabled." 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 fi
if [ "x${NVTXFLAGS}" = "x" ]; then if [ "x${NVTXFLAGS}" = "x" ]; then
echo "INFO: NVTX profiling is disabled." echo "INFO: NVTX profiling is disabled."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment