aboutsummaryrefslogtreecommitdiff
path: root/libgomp/plugin
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2022-05-12 22:46:40 +0200
committerThomas Schwinge <thomas@codesourcery.com>2022-06-10 17:08:57 +0200
commit1459b55d24ce6508330690bf4c932f7a5218c9f3 (patch)
treeaaecd91842f169775b3c6204cbe1d6a0c27862de /libgomp/plugin
parent671970a5621e18e7079b4ca113e56434c858db66 (diff)
downloadgcc-1459b55d24ce6508330690bf4c932f7a5218c9f3.zip
gcc-1459b55d24ce6508330690bf4c932f7a5218c9f3.tar.gz
gcc-1459b55d24ce6508330690bf4c932f7a5218c9f3.tar.bz2
libgomp nvptx plugin: Remove '--with-cuda-driver=[...]' etc. configuration option
That means, exposing to the user only the '--without-cuda-driver' behavior: including the GCC-shipped 'include/cuda/cuda.h' (not system <cuda.h>), and 'dlopen'ing the CUDA Driver library (not linking it). For development purposes, the libgomp nvptx plugin developer may still manually override that, to get the previous '--with-cuda-driver' behavior. libgomp/ * plugin/Makefrag.am: Evaluate 'if PLUGIN_NVPTX_DYNAMIC' to true. * plugin/configfrag.ac (--with-cuda-driver) (--with-cuda-driver-include, --with-cuda-driver-lib) (CUDA_DRIVER_INCLUDE, CUDA_DRIVER_LIB, PLUGIN_NVPTX_CPPFLAGS) (PLUGIN_NVPTX_LDFLAGS, PLUGIN_NVPTX_LIBS, PLUGIN_NVPTX_DYNAMIC): Remove. * testsuite/libgomp-test-support.exp.in (cuda_driver_include) (cuda_driver_lib): Remove. * testsuite/lib/libgomp.exp (libgomp_init): Don't consider these. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/Makefile.in: Likewise.
Diffstat (limited to 'libgomp/plugin')
-rw-r--r--libgomp/plugin/Makefrag.am25
-rw-r--r--libgomp/plugin/configfrag.ac90
2 files changed, 12 insertions, 103 deletions
diff --git a/libgomp/plugin/Makefrag.am b/libgomp/plugin/Makefrag.am
index 66c8c12..5aad9ab 100644
--- a/libgomp/plugin/Makefrag.am
+++ b/libgomp/plugin/Makefrag.am
@@ -39,21 +39,18 @@ libgomp_plugin_nvptx_la_LDFLAGS = $(libgomp_plugin_nvptx_version_info) \
libgomp_plugin_nvptx_la_LIBADD = libgomp.la
libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
-# Including the GCC-shipped 'include/cuda/cuda.h' vs. system <cuda.h>.
-if PLUGIN_NVPTX_DYNAMIC
-else
-libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H
-libgomp_plugin_nvptx_la_CPPFLAGS += $(PLUGIN_NVPTX_CPPFLAGS)
-endif
-
-# 'dlopen'ing the CUDA Driver library vs. linking it.
-if PLUGIN_NVPTX_DYNAMIC
+# libgomp nvptx plugin developer's section.
+#
+# Including the GCC-shipped 'include/cuda/cuda.h' (default) vs. system <cuda.h>:
+#libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H
+#libgomp_plugin_nvptx_la_CPPFLAGS += -I[CUDA]/include
+#
+# 'dlopen'ing the CUDA Driver library (default):
libgomp_plugin_nvptx_la_LIBADD += $(DL_LIBS)
-else
-libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_LINK_LIBCUDA
-libgomp_plugin_nvptx_la_LDFLAGS += $(PLUGIN_NVPTX_LDFLAGS)
-libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS)
-endif
+# ... vs. linking it:
+#libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_LINK_LIBCUDA
+#libgomp_plugin_nvptx_la_LDFLAGS += -L[CUDA]/lib64/stubs
+#libgomp_plugin_nvptx_la_LIBADD += -lcuda
endif
if PLUGIN_GCN
diff --git a/libgomp/plugin/configfrag.ac b/libgomp/plugin/configfrag.ac
index 1420304..ab03f94 100644
--- a/libgomp/plugin/configfrag.ac
+++ b/libgomp/plugin/configfrag.ac
@@ -40,60 +40,8 @@ AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CHECK_FUNCS_ONCE(secure_getenv __secure_getenv getuid geteuid getgid getegid)
-# Look for the CUDA driver package.
-CUDA_DRIVER_INCLUDE=
-CUDA_DRIVER_LIB=
-AC_SUBST(CUDA_DRIVER_INCLUDE)
-AC_SUBST(CUDA_DRIVER_LIB)
-CUDA_DRIVER_CPPFLAGS=
-CUDA_DRIVER_LDFLAGS=
-AC_ARG_WITH(cuda-driver,
- [AS_HELP_STRING([--with-cuda-driver=PATH],
- [specify prefix directory for installed CUDA driver package.
- Equivalent to --with-cuda-driver-include=PATH/include
- plus --with-cuda-driver-lib=PATH/lib])])
-AC_ARG_WITH(cuda-driver-include,
- [AS_HELP_STRING([--with-cuda-driver-include=PATH],
- [specify directory for installed CUDA driver include files])])
-AC_ARG_WITH(cuda-driver-lib,
- [AS_HELP_STRING([--with-cuda-driver-lib=PATH],
- [specify directory for the installed CUDA driver library])])
-case "x$with_cuda_driver" in
- x) ;;
- xno)
- CUDA_DRIVER_INCLUDE=no
- CUDA_DRIVER_LIB=no
- ;;
- *) CUDA_DRIVER_INCLUDE=$with_cuda_driver/include
- CUDA_DRIVER_LIB=$with_cuda_driver/lib
- ;;
-esac
-if test "x$with_cuda_driver_include" != x; then
- CUDA_DRIVER_INCLUDE=$with_cuda_driver_include
-fi
-if test "x$with_cuda_driver_lib" != x; then
- CUDA_DRIVER_LIB=$with_cuda_driver_lib
-fi
-if test "x$CUDA_DRIVER_INCLUDE" != x \
- && test "x$CUDA_DRIVER_INCLUDE" != xno; then
- CUDA_DRIVER_CPPFLAGS=-I$CUDA_DRIVER_INCLUDE
-fi
-if test "x$CUDA_DRIVER_LIB" != x \
- && test "x$CUDA_DRIVER_LIB" != xno; then
- CUDA_DRIVER_LDFLAGS=-L$CUDA_DRIVER_LIB
-fi
-
PLUGIN_NVPTX=0
-PLUGIN_NVPTX_CPPFLAGS=
-PLUGIN_NVPTX_LDFLAGS=
-PLUGIN_NVPTX_LIBS=
-PLUGIN_NVPTX_DYNAMIC=0
-AC_SUBST(PLUGIN_NVPTX_CPPFLAGS)
-AC_SUBST(PLUGIN_NVPTX_LDFLAGS)
-AC_SUBST(PLUGIN_NVPTX_LIBS)
-
PLUGIN_GCN=0
-
# Parse '--enable-offload-targets', figure out the corresponding libgomp
# plugins, and configure to find the corresponding offload compilers.
# 'offload_plugins' and 'offload_targets' will be populated in the same order.
@@ -125,42 +73,7 @@ if test x"$enable_offload_targets" != x; then
;;
*)
tgt_plugin=nvptx
- PLUGIN_NVPTX=$tgt
- if test "x$CUDA_DRIVER_LIB" != xno \
- && test "x$CUDA_DRIVER_LIB" != xno; then
- PLUGIN_NVPTX_CPPFLAGS=$CUDA_DRIVER_CPPFLAGS
- PLUGIN_NVPTX_LDFLAGS=$CUDA_DRIVER_LDFLAGS
- PLUGIN_NVPTX_LIBS='-lcuda'
-
- PLUGIN_NVPTX_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$PLUGIN_NVPTX_CPPFLAGS $CPPFLAGS"
- PLUGIN_NVPTX_save_LDFLAGS=$LDFLAGS
- LDFLAGS="$PLUGIN_NVPTX_LDFLAGS $LDFLAGS"
- PLUGIN_NVPTX_save_LIBS=$LIBS
- LIBS="$PLUGIN_NVPTX_LIBS $LIBS"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [#include "cuda.h"],
- [CUresult r = cuCtxPushCurrent (NULL);])],
- [PLUGIN_NVPTX=1])
- CPPFLAGS=$PLUGIN_NVPTX_save_CPPFLAGS
- LDFLAGS=$PLUGIN_NVPTX_save_LDFLAGS
- LIBS=$PLUGIN_NVPTX_save_LIBS
- fi
- case $PLUGIN_NVPTX in
- nvptx*)
- if (test "x$CUDA_DRIVER_INCLUDE" = x \
- || test "x$CUDA_DRIVER_INCLUDE" = xno) \
- && (test "x$CUDA_DRIVER_LIB" = x \
- || test "x$CUDA_DRIVER_LIB" = xno); then
- PLUGIN_NVPTX=1
- PLUGIN_NVPTX_DYNAMIC=1
- else
- PLUGIN_NVPTX=0
- AC_MSG_ERROR([CUDA driver package required for nvptx support])
- fi
- ;;
- esac
+ PLUGIN_NVPTX=1
;;
esac
;;
@@ -216,5 +129,4 @@ fi
AC_DEFINE_UNQUOTED(OFFLOAD_PLUGINS, "$offload_plugins",
[Define to offload plugins, separated by commas.])
AM_CONDITIONAL([PLUGIN_NVPTX], [test $PLUGIN_NVPTX = 1])
-AM_CONDITIONAL([PLUGIN_NVPTX_DYNAMIC], [test $PLUGIN_NVPTX_DYNAMIC = 1])
AM_CONDITIONAL([PLUGIN_GCN], [test $PLUGIN_GCN = 1])