mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 12:23:43 +01:00
GPU acceleration selection in configure
This commit is contained in:
parent
7e45c517d9
commit
a2f4bc218d
24
configure
vendored
24
configure
vendored
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user