|
@@ -1052,18 +1052,23 @@ if test x$enable_simgrid = xyes ; then
|
|
|
maxnodes=16
|
|
|
else
|
|
|
# We have one memory node shared by all CPU workers, one node per GPU
|
|
|
- maxnodes=1
|
|
|
+ nodes=1
|
|
|
if test x$enable_cuda = xyes ; then
|
|
|
# we could have used nmaxcudadev + 1, but this would certainly give an
|
|
|
# odd number.
|
|
|
- maxnodes=`expr $nodes + $nmaxcudadev`
|
|
|
+ nodes=`expr $nodes + $nmaxcudadev`
|
|
|
fi
|
|
|
if test x$enable_opencl = xyes ; then
|
|
|
# we could have used nmaxcudadev + 1, but this would certainly give an
|
|
|
# odd number.
|
|
|
- maxnodes=`expr $nodes + $nmaxopencldev`
|
|
|
+ nodes=`expr $nodes + $nmaxopencldev`
|
|
|
fi
|
|
|
- # todo: set maxnodes to the next power of 2 greater than maxnodes
|
|
|
+ # set maxnodes to the next power of 2 greater than nodes
|
|
|
+ maxnodes=1
|
|
|
+ while test "$maxnodes" -lt "$nodes"
|
|
|
+ do
|
|
|
+ maxnodes=`expr $maxnodes \* 2`
|
|
|
+ done
|
|
|
fi
|
|
|
|
|
|
AC_MSG_CHECKING(maximum number of memory nodes)
|