|
@@ -220,9 +220,73 @@ if test x$enable_cuda = xyes; then
|
|
|
NVCCFLAGS="${NVCCFLAGS} -m64"
|
|
|
AC_SUBST(NVCCFLAGS)
|
|
|
fi
|
|
|
+fi
|
|
|
+
|
|
|
+enable_magma=no
|
|
|
+if test x$enable_cuda = xyes; then
|
|
|
+ # Should we use the MAGMA library (instead or in addition to CUBLAS)
|
|
|
+ magma_dir=/usr/local # default
|
|
|
+ enable_magma=maybe
|
|
|
+
|
|
|
+ AC_ARG_WITH(magma, [AS_HELP_STRING([--with-magma=<path>],
|
|
|
+ [specify that MAGMA should be used and its installation directory])],
|
|
|
+ [
|
|
|
+ if test x$withval = xyes; then
|
|
|
+ # No path was specified but MAGMA is explicitely enabled
|
|
|
+ enable_magma=yes
|
|
|
+ else
|
|
|
+ if test x$withval = xno; then
|
|
|
+ # MAGMA is explicitely disabled
|
|
|
+ enable_magma=no
|
|
|
+ else
|
|
|
+ # MAGMA is enabled and the PATH is given in $withval
|
|
|
+ enable_magma=yes
|
|
|
+ magma_dir=$withval
|
|
|
+ fi
|
|
|
+ fi
|
|
|
+ ], [])
|
|
|
+
|
|
|
+ # Do we have a valid MAGMA setup ?
|
|
|
+ if test x$enable_magma = xyes -o x$enable_magma = xmaybe; then
|
|
|
+ SAVED_LDFLAGS="${LDFLAGS}"
|
|
|
+ SAVED_CPPFLAGS="${CPPFLAGS}"
|
|
|
+ if test -d "$magma_dir/lib/"; then
|
|
|
+ LDFLAGS="${SAVED_LDFLAGS} -L$magma_dir/lib/ "
|
|
|
+ have_valid_magma=yes
|
|
|
+ AC_CHECK_LIB(magmablas, main,,[have_valid_magma=no])
|
|
|
+ AC_CHECK_LIB(magma, magmablas_sgemm,,[have_valid_magma=no])
|
|
|
+ fi
|
|
|
+
|
|
|
+ if test -d "$magma_dir/include/"; then
|
|
|
+ CPPFLAGS="${SAVED_CPPFLAGS} -I$magma_dir/include/ "
|
|
|
+ AC_CHECK_HEADER([magmablas.h],,[have_valid_magma=no])
|
|
|
+ #AC_CHECK_HEADER([magma.h],,[have_valid_magma=no])
|
|
|
+ fi
|
|
|
|
|
|
+ if test x$have_valid_magma = xno; then
|
|
|
+ # If MAGMA was explicitely required, this is an error
|
|
|
+ if test x$enable_magma = xyes; then
|
|
|
+ AC_MSG_ERROR([cannot find MAGMA])
|
|
|
+ fi
|
|
|
+
|
|
|
+ # Restore old flags and don't use MAGMA
|
|
|
+ LDFLAGS="${SAVED_LDFLAGS}"
|
|
|
+ CPPFLAGS="${SAVED_CPPFLAGS}"
|
|
|
+ enable_magma=no
|
|
|
+ else
|
|
|
+ enable_magma=yes
|
|
|
+ fi
|
|
|
+
|
|
|
+ else
|
|
|
+ have_valid_magma=no
|
|
|
+ enable_magma=no
|
|
|
+ fi
|
|
|
fi
|
|
|
|
|
|
+AC_MSG_CHECKING(whether MAGMA should be used)
|
|
|
+AC_MSG_RESULT($enable_magma)
|
|
|
+AC_DEFINE(STARPU_HAVE_MAGMA, [1], [use MAGMA library])
|
|
|
+
|
|
|
# cufftDoubleComplex may not be available on an old CUDA setup
|
|
|
AC_CHECK_TYPE(cufftDoubleComplex,
|
|
|
[have_cufftdoublecomplex=yes],
|