summaryrefslogtreecommitdiffstats
path: root/build/linux
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2014-10-02 15:19:47 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-01-19 11:15:32 +0100
commit35fa8514fcd344615f19fb359471161b6bd58c73 (patch)
tree402a30eab2c7f1835c5e88457ef1dddf34752eca /build/linux
parent1341bd26aa9007c3fe91044425ae3a96e8b4854b (diff)
downloadastra-35fa8514fcd344615f19fb359471161b6bd58c73.tar.gz
astra-35fa8514fcd344615f19fb359471161b6bd58c73.tar.bz2
astra-35fa8514fcd344615f19fb359471161b6bd58c73.tar.xz
astra-35fa8514fcd344615f19fb359471161b6bd58c73.zip
Add --with-cuda-compute option to configure
Diffstat (limited to 'build/linux')
-rw-r--r--build/linux/acinclude.m46
-rw-r--r--build/linux/configure.ac8
2 files changed, 11 insertions, 3 deletions
diff --git a/build/linux/acinclude.m4 b/build/linux/acinclude.m4
index 313e849..5022e5b 100644
--- a/build/linux/acinclude.m4
+++ b/build/linux/acinclude.m4
@@ -74,7 +74,7 @@ rm -f conftest.cu conftest.o conftest.nvcc.out
])
dnl ASTRA_FIND_NVCC_ARCHS(archs-to-try,cppflags-to-extend,output-list)
-dnl Architectures should be of the form 10, 20, 30, 35,
+dnl Architectures should be of the form 10,20,30,35,
dnl and should be in order. The last accepted one will be used for PTX output.
dnl All accepted ones will be used for cubin output.
AC_DEFUN([ASTRA_FIND_NVCC_ARCHS],[
@@ -88,7 +88,10 @@ _ACEOF
NVCC_lastarch="none"
NVCC_extra=""
NVCC_list=""
+astra_save_IFS=$IFS
+IFS=,
for arch in $1; do
+ IFS=$astra_save_IFS
NVCC_opt="-gencode=arch=compute_$arch,code=sm_$arch"
$NVCC -c -o conftest.o conftest.cu $$2 $NVCC_opt >conftest.nvcc.out 2>&1 && {
NVCC_lastarch=$arch
@@ -96,6 +99,7 @@ for arch in $1; do
NVCC_list="${NVCC_list:+$NVCC_list, }$arch"
}
done
+IFS=$astra_save_IFS
if test $NVCC_lastarch != none; then
NVCC_extra="$NVCC_extra -gencode=arch=compute_${NVCC_lastarch},code=compute_${NVCC_lastarch}"
$3="$NVCC_list"
diff --git a/build/linux/configure.ac b/build/linux/configure.ac
index 4c9685b..11a8ff2 100644
--- a/build/linux/configure.ac
+++ b/build/linux/configure.ac
@@ -121,11 +121,15 @@ if test x"$HAVECUDA" = xyes; then
fi
AC_MSG_RESULT($HAVECUDA)
+AC_ARG_WITH(cuda_compute, [[ --with-cuda-compute=archs comma separated list of CUDA compute models (optional)]],,)
if test x"$HAVECUDA" = xyes; then
AC_MSG_CHECKING([for nvcc archs])
dnl 10 11 12 13 20 30 32 35 37 50
- ASTRA_FIND_NVCC_ARCHS([10 12 20 30 35 50],NVCCFLAGS,NVCCARCHS)
- AC_MSG_RESULT($NVCCARCHS)
+ if test x"$with_cuda_compute" = x; then
+ with_cuda_compute="10,12,20,30,35,50"
+ fi
+ ASTRA_FIND_NVCC_ARCHS([$with_cuda_compute],NVCCFLAGS,NVCCARCHS)
+ AC_MSG_RESULT([$NVCCARCHS])
fi