Move CUDA-aware configurary to its own file and other minor changes due to review.
This commit was SVN r28832.
Этот коммит содержится в:
родитель
6e8522fec5
Коммит
49663fb802
98
config/opal_check_cuda.m4
Обычный файл
98
config/opal_check_cuda.m4
Обычный файл
@ -0,0 +1,98 @@
|
|||||||
|
dnl -*- shell-script -*-
|
||||||
|
dnl
|
||||||
|
dnl Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
||||||
|
dnl University Research and Technology
|
||||||
|
dnl Corporation. All rights reserved.
|
||||||
|
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||||
|
dnl of Tennessee Research Foundation. All rights
|
||||||
|
dnl reserved.
|
||||||
|
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||||
|
dnl University of Stuttgart. All rights reserved.
|
||||||
|
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
|
dnl All rights reserved.
|
||||||
|
dnl Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
|
||||||
|
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
||||||
|
dnl Copyright (c) 2009 IBM Corporation. All rights reserved.
|
||||||
|
dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights
|
||||||
|
dnl reserved.
|
||||||
|
dnl Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved.
|
||||||
|
dnl Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
|
||||||
|
dnl
|
||||||
|
dnl $COPYRIGHT$
|
||||||
|
dnl
|
||||||
|
dnl Additional copyrights may follow
|
||||||
|
dnl
|
||||||
|
dnl $HEADER$
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([OPAL_CHECK_CUDA],[
|
||||||
|
#
|
||||||
|
# Check to see if user wants CUDA support
|
||||||
|
#
|
||||||
|
AC_ARG_WITH([cuda],
|
||||||
|
[AC_HELP_STRING([--with-cuda(=DIR)],
|
||||||
|
[Build cuda support, optionally adding DIR/include])])
|
||||||
|
AC_MSG_CHECKING([if --with-cuda is set])
|
||||||
|
|
||||||
|
# Note that CUDA support is off by default. To turn it on, the user has to
|
||||||
|
# request it. The user can just ask for --with-cuda and it that case we
|
||||||
|
# look for the cuda.h file in /usr/local/cuda. Otherwise, they can give
|
||||||
|
# us a directory. If they provide a directory, we will look in that directory
|
||||||
|
# as well as the directory with the "include" string appended to it. The fact
|
||||||
|
# that we check in two directories precludes us from using the OMPI_CHECK_DIR
|
||||||
|
# macro as that would error out after not finding it in the first directory.
|
||||||
|
# Note that anywhere CUDA aware code is in the Open MPI repository requires
|
||||||
|
# us to make use of AC_REQUIRE to ensure this check has been done.
|
||||||
|
AS_IF([test "$with_cuda" = "no" -o "x$with_cuda" = "x"],
|
||||||
|
[opal_check_cuda_happy="no"
|
||||||
|
AC_MSG_RESULT([not set (--with-cuda=$with_cuda)])],
|
||||||
|
[AS_IF([test "$with_cuda" = "yes"],
|
||||||
|
[AS_IF([test "x`ls /usr/local/cuda/include/cuda.h 2> /dev/null`" = "x"],
|
||||||
|
[AC_MSG_RESULT([not found in standard location])
|
||||||
|
AC_MSG_WARN([Expected file /usr/local/cuda/include/cuda.h not found])
|
||||||
|
AC_MSG_ERROR([Cannot continue])],
|
||||||
|
[AC_MSG_RESULT([found])
|
||||||
|
opal_check_cuda_happy=yes
|
||||||
|
opal_cuda_incdir=/usr/local/cuda/include])],
|
||||||
|
[AS_IF([test ! -d "$with_cuda"],
|
||||||
|
[AC_MSG_RESULT([not found])
|
||||||
|
AC_MSG_WARN([Directory $with_cuda not found])
|
||||||
|
AC_MSG_ERROR([Cannot continue])],
|
||||||
|
[AS_IF([test "x`ls $with_cuda/include/cuda.h 2> /dev/null`" = "x"],
|
||||||
|
[AS_IF([test "x`ls $with_cuda/cuda.h 2> /dev/null`" = "x"],
|
||||||
|
[AC_MSG_RESULT([not found])
|
||||||
|
AC_MSG_WARN([Could not find cuda.h in $with_cuda/include or $with_cuda])
|
||||||
|
AC_MSG_ERROR([Cannot continue])],
|
||||||
|
[opal_check_cuda_happy=yes
|
||||||
|
opal_cuda_incdir=$with_cuda
|
||||||
|
AC_MSG_RESULT([found ($with_cuda/cuda.h)])])],
|
||||||
|
[opal_check_cuda_happy=yes
|
||||||
|
opal_cuda_incdir="$with_cuda/include"
|
||||||
|
AC_MSG_RESULT([found ($opal_cuda_incdir/cuda.h)])])])])])
|
||||||
|
|
||||||
|
# If we have CUDA support, check to see if we have CUDA 4.1 support
|
||||||
|
AS_IF([test "$opal_check_cuda_happy"="yes"],
|
||||||
|
AC_CHECK_HEADER([$opal_cuda_incdir/cuda.h])
|
||||||
|
AC_CHECK_MEMBER([struct CUipcMemHandle_st.reserved], [CUDA_SUPPORT_41=1], [CUDA_SUPPORT_41=0],
|
||||||
|
[#include <$opal_cuda_incdir/cuda.h>]),
|
||||||
|
[])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([if have cuda support])
|
||||||
|
if test "$opal_check_cuda_happy" = "yes"; then
|
||||||
|
AC_MSG_RESULT([yes (-I$with_cuda)])
|
||||||
|
CUDA_SUPPORT=1
|
||||||
|
opal_datatype_cuda_CPPFLAGS="-I$opal_cuda_incdir"
|
||||||
|
AC_SUBST([opal_datatype_cuda_CPPFLAGS])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
CUDA_SUPPORT=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
AM_CONDITIONAL([OPAL_cuda_support], [test "x$CUDA_SUPPORT" = "x1"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPAL_CUDA_SUPPORT],$CUDA_SUPPORT,
|
||||||
|
[Whether we want cuda device pointer support])
|
||||||
|
|
||||||
|
AM_CONDITIONAL([OPAL_cuda_support_41], [test "x$CUDA_SUPPORT_41" = "x1"])
|
||||||
|
AC_DEFINE_UNQUOTED([OPAL_CUDA_SUPPORT_41],$CUDA_SUPPORT_41,
|
||||||
|
[Whether we have CUDA 4.1 support available])
|
||||||
|
|
||||||
|
])
|
@ -464,66 +464,4 @@ AC_ARG_WITH([libltdl],
|
|||||||
AC_DEFINE_UNQUOTED([OPAL_ENABLE_CRDEBUG], [0],
|
AC_DEFINE_UNQUOTED([OPAL_ENABLE_CRDEBUG], [0],
|
||||||
[Whether we want checkpoint/restart enabled debugging functionality or not])
|
[Whether we want checkpoint/restart enabled debugging functionality or not])
|
||||||
|
|
||||||
#
|
|
||||||
# Check to see if user wants CUDA support
|
|
||||||
#
|
|
||||||
AC_ARG_WITH([cuda],
|
|
||||||
[AC_HELP_STRING([--with-cuda(=DIR)],
|
|
||||||
[Build cuda support, optionally adding DIR/include])])
|
|
||||||
AC_MSG_CHECKING([if --with-cuda is set])
|
|
||||||
|
|
||||||
# CUDA support is off by default. User has to request it. Look for cuda.h file.
|
|
||||||
AS_IF([test "$with_cuda" = "no" -o "x$with_cuda" = "x"],
|
|
||||||
[opal_check_cuda_happy="no"
|
|
||||||
AC_MSG_RESULT([not set (--with-cuda=$with_cuda)])],
|
|
||||||
[AS_IF([test "$with_cuda" = "yes"],
|
|
||||||
[AS_IF([test "x`ls /usr/local/cuda/include/cuda.h 2> /dev/null`" = "x"],
|
|
||||||
[AC_MSG_RESULT([not found in standard location])
|
|
||||||
AC_MSG_WARN([Expected file /usr/local/cuda/include/cuda.h not found])
|
|
||||||
AC_MSG_ERROR([Cannot continue])],
|
|
||||||
[AC_MSG_RESULT([found])
|
|
||||||
opal_check_cuda_happy="yes"
|
|
||||||
with_cuda="/usr/local/cuda/include"])],
|
|
||||||
[AS_IF([test ! -d "$with_cuda"],
|
|
||||||
[AC_MSG_RESULT([not found])
|
|
||||||
AC_MSG_WARN([Directory $with_cuda not found])
|
|
||||||
AC_MSG_ERROR([Cannot continue])],
|
|
||||||
[AS_IF([test "x`ls $with_cuda/include/cuda.h 2> /dev/null`" = "x"],
|
|
||||||
[AS_IF([test "x`ls $with_cuda/cuda.h 2> /dev/null`" = "x"],
|
|
||||||
[AC_MSG_RESULT([not found])
|
|
||||||
AC_MSG_WARN([Could not find cuda.h in $with_cuda/include or $with_cuda])
|
|
||||||
AC_MSG_ERROR([Cannot continue])],
|
|
||||||
[opal_check_cuda_happy="yes"
|
|
||||||
with_cuda="$with_cuda"
|
|
||||||
AC_MSG_RESULT([found ($with_cuda/cuda.h)])])],
|
|
||||||
[opal_check_cuda_happy="yes"
|
|
||||||
with_cuda="$with_cuda/include"
|
|
||||||
AC_MSG_RESULT([found ($with_cuda/cuda.h)])])])])])
|
|
||||||
|
|
||||||
# If we have CUDA support, check to see if we have CUDA 4.1 support
|
|
||||||
AS_IF([test "$opal_check_cuda_happy"="yes"],
|
|
||||||
AC_CHECK_MEMBER([struct CUipcMemHandle_st.reserved], [CUDA_SUPPORT_41=1], [CUDA_SUPPORT_41=0],
|
|
||||||
[#include <$with_cuda/cuda.h>]),
|
|
||||||
[])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([if have cuda support])
|
|
||||||
if test "$opal_check_cuda_happy" = "yes"; then
|
|
||||||
AC_MSG_RESULT([yes (-I$with_cuda)])
|
|
||||||
CUDA_SUPPORT=1
|
|
||||||
opal_datatype_cuda_CPPFLAGS="-I$with_cuda"
|
|
||||||
AC_SUBST([opal_datatype_cuda_CPPFLAGS])
|
|
||||||
AC_SUBST([opal_datatype_cuda_LIBS])
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
CUDA_SUPPORT=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL([OPAL_cuda_support], [test "x$CUDA_SUPPORT" = "x1"])
|
|
||||||
AC_DEFINE_UNQUOTED([OPAL_CUDA_SUPPORT],$CUDA_SUPPORT,
|
|
||||||
[Whether we want cuda device pointer support])
|
|
||||||
|
|
||||||
AM_CONDITIONAL([OPAL_cuda_support_41], [test "x$CUDA_SUPPORT_41" = "x1"])
|
|
||||||
AC_DEFINE_UNQUOTED([OPAL_CUDA_SUPPORT_41],$CUDA_SUPPORT_41,
|
|
||||||
[Whether we have CUDA 4.1 support available])
|
|
||||||
|
|
||||||
])dnl
|
])dnl
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
# Copyright (c) 2006-2011 Los Alamos National Security, LLC. All rights
|
# Copyright (c) 2006-2011 Los Alamos National Security, LLC. All rights
|
||||||
# reserved.
|
# reserved.
|
||||||
# Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
# Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||||
# Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
|
# Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
|
||||||
# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
#
|
#
|
||||||
@ -237,6 +237,7 @@ AC_SUBST(top_ompi_builddir)
|
|||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
OPAL_CONFIGURE_OPTIONS
|
OPAL_CONFIGURE_OPTIONS
|
||||||
|
OPAL_CHECK_CUDA
|
||||||
m4_ifdef([project_orte], [ORTE_CONFIGURE_OPTIONS])
|
m4_ifdef([project_orte], [ORTE_CONFIGURE_OPTIONS])
|
||||||
m4_ifdef([project_ompi], [OMPI_CONFIGURE_OPTIONS])
|
m4_ifdef([project_ompi], [OMPI_CONFIGURE_OPTIONS])
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
# Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
# Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
||||||
# Copyright (c) 2008-2011 Mellanox Technologies. All rights reserved.
|
# Copyright (c) 2008-2011 Mellanox Technologies. All rights reserved.
|
||||||
# Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
|
||||||
|
# Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
#
|
#
|
||||||
# Additional copyrights may follow
|
# Additional copyrights may follow
|
||||||
@ -116,6 +117,9 @@ AC_DEFUN([MCA_ompi_btl_openib_CONFIG],[
|
|||||||
|
|
||||||
AC_DEFINE_UNQUOTED(BTL_OPENIB_MALLOC_HOOKS_ENABLED, [$btl_openib_malloc_hooks_enabled],
|
AC_DEFINE_UNQUOTED(BTL_OPENIB_MALLOC_HOOKS_ENABLED, [$btl_openib_malloc_hooks_enabled],
|
||||||
[Whether the openib BTL malloc hooks are enabled])
|
[Whether the openib BTL malloc hooks are enabled])
|
||||||
|
|
||||||
|
# make sure that CUDA-aware checks have been done
|
||||||
|
AC_REQUIRE([OPAL_CHECK_CUDA])
|
||||||
|
|
||||||
# substitute in the things needed to build openib
|
# substitute in the things needed to build openib
|
||||||
AC_SUBST([btl_openib_CFLAGS])
|
AC_SUBST([btl_openib_CFLAGS])
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# of Tennessee Research Foundation. All rights
|
# of Tennessee Research Foundation. All rights
|
||||||
# reserved.
|
# reserved.
|
||||||
# Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
|
# Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
|
||||||
# Copyright (c) 2012 NVIDIA Corporation. All rights reserved.
|
# Copyright (c) 2012-2013 NVIDIA Corporation. All rights reserved.
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
#
|
#
|
||||||
# Additional copyrights may follow
|
# Additional copyrights may follow
|
||||||
@ -18,6 +18,9 @@
|
|||||||
AC_DEFUN([MCA_ompi_btl_smcuda_CONFIG],[
|
AC_DEFUN([MCA_ompi_btl_smcuda_CONFIG],[
|
||||||
AC_CONFIG_FILES([ompi/mca/btl/smcuda/Makefile])
|
AC_CONFIG_FILES([ompi/mca/btl/smcuda/Makefile])
|
||||||
|
|
||||||
|
# make sure that CUDA-aware checks have been done
|
||||||
|
AC_REQUIRE([OPAL_CHECK_CUDA])
|
||||||
|
|
||||||
# Only build if CUDA 4.1 support is available
|
# Only build if CUDA 4.1 support is available
|
||||||
AS_IF([test "x$CUDA_SUPPORT_41" = "x1"],
|
AS_IF([test "x$CUDA_SUPPORT_41" = "x1"],
|
||||||
[$1],
|
[$1],
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
AC_DEFUN([MCA_ompi_common_cuda_CONFIG],[
|
AC_DEFUN([MCA_ompi_common_cuda_CONFIG],[
|
||||||
AC_CONFIG_FILES([ompi/mca/common/cuda/Makefile])
|
AC_CONFIG_FILES([ompi/mca/common/cuda/Makefile])
|
||||||
|
|
||||||
|
# make sure that CUDA-aware checks have been done
|
||||||
|
AC_REQUIRE([OPAL_CHECK_CUDA])
|
||||||
|
|
||||||
# Use CUDA_SUPPORT which was filled in by the opal configure code.
|
# Use CUDA_SUPPORT which was filled in by the opal configure code.
|
||||||
AM_CONDITIONAL([MCA_ompi_cuda_support], [test "x$CUDA_SUPPORT" = "x1"])
|
AM_CONDITIONAL([MCA_ompi_cuda_support], [test "x$CUDA_SUPPORT" = "x1"])
|
||||||
AC_DEFINE_UNQUOTED([OMPI_CUDA_SUPPORT],$CUDA_SUPPORT,
|
AC_DEFINE_UNQUOTED([OMPI_CUDA_SUPPORT],$CUDA_SUPPORT,
|
||||||
@ -33,6 +36,5 @@ AC_DEFUN([MCA_ompi_common_cuda_CONFIG],[
|
|||||||
# Copy over the includes needed to build CUDA
|
# Copy over the includes needed to build CUDA
|
||||||
common_cuda_CPPFLAGS=$opal_datatype_cuda_CPPFLAGS
|
common_cuda_CPPFLAGS=$opal_datatype_cuda_CPPFLAGS
|
||||||
AC_SUBST([common_cuda_CPPFLAGS])
|
AC_SUBST([common_cuda_CPPFLAGS])
|
||||||
AC_SUBST([common_cuda_LIBS])
|
|
||||||
|
|
||||||
])dnl
|
])dnl
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user