Skip to content

Commit b4355c2

Browse files
authored
Merge pull request #10857 from wckzhang/removefunc
opal/accelerator: Remove function table and dlopen logic
2 parents dae2af5 + d5ba0a3 commit b4355c2

26 files changed

+386
-3068
lines changed

config/opal_check_cuda.m4

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,22 @@ dnl
2727
dnl $HEADER$
2828
dnl
2929

30+
31+
# OPAL_CHECK_CUDA(prefix, [action-if-found], [action-if-not-found])
32+
# --------------------------------------------------------
33+
# check if CUDA support can be found. sets prefix_{CPPFLAGS,
34+
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
35+
# support, otherwise executes action-if-not-found
36+
37+
#
38+
# Check for CUDA support
39+
#
3040
AC_DEFUN([OPAL_CHECK_CUDA],[
41+
OPAL_VAR_SCOPE_PUSH([cuda_save_CPPFLAGS cuda_save_LDFLAGS cuda_save_LIBS])
42+
43+
cuda_save_CPPFLAGS="$CPPFLAGS"
44+
cuda_save_LDFLAGS="$LDFLAGS"
45+
cuda_save_LIBS="$LIBS"
3146
#
3247
# Check to see if user wants CUDA support
3348
#
@@ -72,12 +87,15 @@ AS_IF([test "$with_cuda" = "no" || test "x$with_cuda" = "x"],
7287
opal_cuda_incdir="$with_cuda/include"
7388
AC_MSG_RESULT([found ($opal_cuda_incdir/cuda.h)])])])])])
7489
75-
dnl We cannot have CUDA support without dlopen support. HOWEVER, at
76-
dnl this point in configure, we can't know whether the DL framework
77-
dnl has been configured or not yet (it likely hasn't, since CUDA is a
78-
dnl common framework, and likely configured first). So we have to
79-
dnl defer this check until later (see the OPAL_CHECK_CUDA_AFTER_OPAL_DL m4
80-
dnl macro, below). :-(
90+
AS_IF([test "$opal_check_cuda_happy" = "yes"],
91+
[OAC_CHECK_PACKAGE([cuda],
92+
[$1],
93+
[cuda.h],
94+
[cuda],
95+
[cuMemFree],
96+
[opal_check_cuda_happy="yes"],
97+
[opal_check_cuda_happy="no"])],
98+
[])
8199
82100
# We require CUDA IPC support which started in CUDA 4.1. Error
83101
# out if the support is not there.
@@ -144,22 +162,9 @@ AM_CONDITIONAL([OPAL_cuda_gdr_support], [test "x$CUDA_VERSION_60_OR_GREATER" = "
144162
AC_DEFINE_UNQUOTED([OPAL_CUDA_GDR_SUPPORT],$CUDA_VERSION_60_OR_GREATER,
145163
[Whether we have CUDA GDR support available])
146164
165+
CPPFLAGS=${cuda_save_CPPFLAGS}
166+
LDFLAGS=${cuda_save_LDFLAGS}
167+
LIBS=${cuda_save_LIBS}
168+
OPAL_VAR_SCOPE_POP
147169
])
148170

149-
dnl
150-
dnl CUDA support requires DL support (it dynamically opens the CUDA
151-
dnl library at run time). But we do not check for OPAL DL support
152-
dnl until lafter the initial OPAL_CHECK_CUDA is called. So put the
153-
dnl CUDA+DL check in a separate macro that can be called after the DL MCA
154-
dnl framework checks in the top-level configure.ac.
155-
dnl
156-
AC_DEFUN([OPAL_CHECK_CUDA_AFTER_OPAL_DL],[
157-
158-
# We cannot have CUDA support without OPAL DL support. Error out
159-
# if the user wants CUDA but we do not have OPAL DL support.
160-
AS_IF([test $OPAL_HAVE_DL_SUPPORT -eq 0 && \
161-
test "$opal_check_cuda_happy" = "yes"],
162-
[AC_MSG_WARN([--with-cuda was specified, but dlopen support is disabled.])
163-
AC_MSG_WARN([You must reconfigure Open MPI with dlopen ("dl") support.])
164-
AC_MSG_ERROR([Cannot continue.])])
165-
])

config/opal_config_files.m4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
AC_DEFUN([OPAL_CONFIG_FILES],[
1818
AC_CONFIG_FILES([
1919
opal/Makefile
20-
opal/cuda/Makefile
2120
opal/etc/Makefile
2221
opal/include/Makefile
2322
opal/datatype/Makefile

configure.ac

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,6 @@ AC_CACHE_SAVE
987987

988988
opal_show_title "System-specific tests"
989989

990-
OPAL_CHECK_CUDA
991990
##################################
992991
OPAL_CHECK_OS_FLAVORS
993992

@@ -1233,8 +1232,6 @@ AC_CACHE_SAVE
12331232
# be done better by having some kind of "run this check at the end of
12341233
# all other MCA checks" hook...?
12351234

1236-
OPAL_CHECK_CUDA_AFTER_OPAL_DL
1237-
12381235
OPAL_CHECK_ROCM_AFTER_OPAL_DL
12391236

12401237
##################################

opal/Makefile.am

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,18 @@
2222
# $HEADER$
2323
#
2424

25-
if OPAL_cuda_support
26-
LIBOPAL_GPU_SUBDIR = cuda
27-
LIBOPAL_GPU_LA = cuda/libopalcuda.la
28-
endif
29-
30-
3125
SUBDIRS = \
3226
include \
3327
datatype \
3428
etc \
3529
util \
3630
mca/base \
37-
$(LIBOPAL_GPU_SUBDIR) \
3831
$(MCA_opal_FRAMEWORKS_SUBDIRS) \
3932
$(MCA_opal_FRAMEWORK_COMPONENT_STATIC_SUBDIRS) \
4033
. \
4134
$(MCA_opal_FRAMEWORK_COMPONENT_DSO_SUBDIRS)
4235
DIST_SUBDIRS = \
4336
include \
44-
cuda \
4537
datatype \
4638
etc \
4739
util \
@@ -67,13 +59,11 @@ lib@OPAL_LIB_NAME@_la_LIBADD = \
6759
libopen-pal_core.la \
6860
datatype/libdatatype.la \
6961
util/libopalutil.la \
70-
$(LIBOPAL_GPU_LA) \
7162
$(MCA_opal_FRAMEWORK_LIBS)
7263
lib@OPAL_LIB_NAME@_la_DEPENDENCIES = \
7364
libopen-pal_core.la \
7465
datatype/libdatatype.la \
7566
util/libopalutil.la \
76-
$(LIBOPAL_GPU_LA) \
7767
$(MCA_opal_FRAMEWORK_LIBS)
7868
lib@OPAL_LIB_NAME@_la_LDFLAGS = -version-info @libopen_pal_so_version@
7969

opal/cuda/Makefile.am

Lines changed: 0 additions & 44 deletions
This file was deleted.

opal/cuda/README.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)