10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-07-18 00:43:43 +02:00

GPU acceleration selection in configure

This commit is contained in:
Anthony Scemama 2024-06-26 13:44:45 +02:00
parent 7e45c517d9
commit a2f4bc218d

24
configure vendored
View File

@ -40,6 +40,7 @@ Usage:
$(basename $0) -c <file>
$(basename $0) -h
$(basename $0) -i <package>
$(basename $0) -g [nvidia|none]
Options:
-c <file> Define a COMPILATION configuration file,
@ -48,6 +49,7 @@ Options:
-i <package> INSTALL <package>. Use at your OWN RISK:
no support will be provided for the installation of
dependencies.
-g [nvidia|none] Choose GPU acceleration (experimental)
Example:
./$(basename $0) -c config/gfortran.cfg
@ -83,7 +85,7 @@ function execute () {
PACKAGES=""
while getopts "d:c:i:h" c ; do
while getopts "d:c:i:g:h" c ; do
case "$c" in
c)
case "$OPTARG" in
@ -100,6 +102,9 @@ while getopts "d:c:i:h" c ; do
"") help ; break;;
*) PACKAGES="${PACKAGE} $OPTARG"
esac;;
g)
GPU=$OPTARG;
break;;
h)
help
exit 0;;
@ -109,6 +114,23 @@ while getopts "d:c:i:h" c ; do
esac
done
# Handle GPU acceleration
rm -f ${QP_ROOT}/src/gpu
case "$GPU" in
amd) # Nvidia
echo "Activating AMD GPU acceleration"
ln -s ${QP_ROOT}/src/gpu_amd ${QP_ROOT}/src/gpu
;;
nvidia) # Nvidia
echo "Activating Nvidia GPU acceleration"
ln -s ${QP_ROOT}/src/gpu_nvidia ${QP_ROOT}/src/gpu
;;
*) # No Acceleration
echo "Disabling GPU acceleration"
ln -s ${QP_ROOT}/src/gpu_x86 ${QP_ROOT}/src/gpu
;;
esac
# Trim leading and trailing spaces
PACKAGES=$(echo $PACKAGES | xargs)