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.
This commit is contained in:
parent
671970a562
commit
1459b55d24
@ -119,18 +119,8 @@ build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
@PLUGIN_NVPTX_TRUE@am__append_1 = libgomp-plugin-nvptx.la
|
||||
|
||||
# Including the GCC-shipped 'include/cuda/cuda.h' vs. system <cuda.h>.
|
||||
@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__append_2 = -DPLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H \
|
||||
@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@ $(PLUGIN_NVPTX_CPPFLAGS) \
|
||||
@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@ -DPLUGIN_NVPTX_LINK_LIBCUDA
|
||||
|
||||
# 'dlopen'ing the CUDA Driver library vs. linking it.
|
||||
@PLUGIN_NVPTX_DYNAMIC_TRUE@@PLUGIN_NVPTX_TRUE@am__append_3 = $(DL_LIBS)
|
||||
@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__append_4 = $(PLUGIN_NVPTX_LDFLAGS)
|
||||
@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__append_5 = $(PLUGIN_NVPTX_LIBS)
|
||||
@PLUGIN_GCN_TRUE@am__append_6 = libgomp-plugin-gcn.la
|
||||
@USE_FORTRAN_TRUE@am__append_7 = openacc.f90
|
||||
@PLUGIN_GCN_TRUE@am__append_2 = libgomp-plugin-gcn.la
|
||||
@USE_FORTRAN_TRUE@am__append_3 = openacc.f90
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
|
||||
@ -207,10 +197,8 @@ libgomp_plugin_gcn_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
||||
$(libgomp_plugin_gcn_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@PLUGIN_GCN_TRUE@am_libgomp_plugin_gcn_la_rpath = -rpath \
|
||||
@PLUGIN_GCN_TRUE@ $(toolexeclibdir)
|
||||
@PLUGIN_NVPTX_DYNAMIC_TRUE@@PLUGIN_NVPTX_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
|
||||
@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1)
|
||||
@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_DEPENDENCIES = libgomp.la \
|
||||
@PLUGIN_NVPTX_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
|
||||
@PLUGIN_NVPTX_TRUE@ $(am__DEPENDENCIES_1)
|
||||
@PLUGIN_NVPTX_TRUE@am_libgomp_plugin_nvptx_la_OBJECTS = \
|
||||
@PLUGIN_NVPTX_TRUE@ libgomp_plugin_nvptx_la-plugin-nvptx.lo
|
||||
libgomp_plugin_nvptx_la_OBJECTS = \
|
||||
@ -380,8 +368,6 @@ CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPU_COUNT = @CPU_COUNT@
|
||||
CUDA_DRIVER_INCLUDE = @CUDA_DRIVER_INCLUDE@
|
||||
CUDA_DRIVER_LIB = @CUDA_DRIVER_LIB@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
@ -443,9 +429,6 @@ PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PLUGIN_NVPTX_CPPFLAGS = @PLUGIN_NVPTX_CPPFLAGS@
|
||||
PLUGIN_NVPTX_LDFLAGS = @PLUGIN_NVPTX_LDFLAGS@
|
||||
PLUGIN_NVPTX_LIBS = @PLUGIN_NVPTX_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SECTION_LDFLAGS = @SECTION_LDFLAGS@
|
||||
SED = @SED@
|
||||
@ -538,7 +521,7 @@ libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
|
||||
AM_CPPFLAGS = $(addprefix -I, $(search_path))
|
||||
AM_CFLAGS = $(XCFLAGS)
|
||||
AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
|
||||
toolexeclib_LTLIBRARIES = libgomp.la $(am__append_1) $(am__append_6)
|
||||
toolexeclib_LTLIBRARIES = libgomp.la $(am__append_1) $(am__append_2)
|
||||
nodist_toolexeclib_HEADERS = libgomp.spec
|
||||
|
||||
# -Wc is only a libtool option.
|
||||
@ -565,19 +548,30 @@ libgomp_la_SOURCES = alloc.c atomic.c barrier.c critical.c env.c \
|
||||
oacc-parallel.c oacc-host.c oacc-init.c oacc-mem.c \
|
||||
oacc-async.c oacc-plugin.c oacc-cuda.c priority_queue.c \
|
||||
affinity-fmt.c teams.c allocator.c oacc-profiling.c \
|
||||
oacc-target.c $(am__append_7)
|
||||
oacc-target.c $(am__append_3)
|
||||
|
||||
# Nvidia PTX OpenACC plugin.
|
||||
@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_version_info = -version-info $(libtool_VERSION)
|
||||
@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_SOURCES = plugin/plugin-nvptx.c
|
||||
@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_CPPFLAGS = $(AM_CPPFLAGS) \
|
||||
@PLUGIN_NVPTX_TRUE@ $(am__append_2)
|
||||
@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LDFLAGS = \
|
||||
@PLUGIN_NVPTX_TRUE@ $(libgomp_plugin_nvptx_version_info) \
|
||||
@PLUGIN_NVPTX_TRUE@ $(lt_host_flags) $(am__append_4)
|
||||
@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LDFLAGS = $(libgomp_plugin_nvptx_version_info) \
|
||||
@PLUGIN_NVPTX_TRUE@ $(lt_host_flags)
|
||||
|
||||
|
||||
# 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):
|
||||
@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBADD = libgomp.la \
|
||||
@PLUGIN_NVPTX_TRUE@ $(am__append_3) $(am__append_5)
|
||||
@PLUGIN_NVPTX_TRUE@ $(DL_LIBS)
|
||||
@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
# ... 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
|
||||
|
||||
# AMD GCN plugin
|
||||
@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_version_info = -version-info $(libtool_VERSION)
|
||||
|
143
libgomp/configure
vendored
143
libgomp/configure
vendored
@ -667,19 +667,12 @@ OPT_LDFLAGS
|
||||
SECTION_LDFLAGS
|
||||
PLUGIN_GCN_FALSE
|
||||
PLUGIN_GCN_TRUE
|
||||
PLUGIN_NVPTX_DYNAMIC_FALSE
|
||||
PLUGIN_NVPTX_DYNAMIC_TRUE
|
||||
PLUGIN_NVPTX_FALSE
|
||||
PLUGIN_NVPTX_TRUE
|
||||
offload_additional_lib_paths
|
||||
offload_additional_options
|
||||
offload_targets
|
||||
offload_plugins
|
||||
PLUGIN_NVPTX_LIBS
|
||||
PLUGIN_NVPTX_LDFLAGS
|
||||
PLUGIN_NVPTX_CPPFLAGS
|
||||
CUDA_DRIVER_LIB
|
||||
CUDA_DRIVER_INCLUDE
|
||||
DL_LIBS
|
||||
libtool_VERSION
|
||||
ac_ct_FC
|
||||
@ -829,9 +822,6 @@ enable_fast_install
|
||||
with_gnu_ld
|
||||
enable_libtool_lock
|
||||
enable_maintainer_mode
|
||||
with_cuda_driver
|
||||
with_cuda_driver_include
|
||||
with_cuda_driver_lib
|
||||
enable_linux_futex
|
||||
enable_tls
|
||||
enable_symvers
|
||||
@ -1504,16 +1494,6 @@ Optional Packages:
|
||||
--with-pic try to use only PIC/non-PIC objects [default=use
|
||||
both]
|
||||
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
|
||||
--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
|
||||
--with-cuda-driver-include=PATH
|
||||
specify directory for installed CUDA driver include
|
||||
files
|
||||
--with-cuda-driver-lib=PATH
|
||||
specify directory for the installed CUDA driver
|
||||
library
|
||||
--with-gcc-major-version-only
|
||||
use only GCC major number in filesystem paths
|
||||
|
||||
@ -11414,7 +11394,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11417 "configure"
|
||||
#line 11397 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -11520,7 +11500,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11523 "configure"
|
||||
#line 11503 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -15158,67 +15138,8 @@ done
|
||||
|
||||
|
||||
|
||||
# Look for the CUDA driver package.
|
||||
CUDA_DRIVER_INCLUDE=
|
||||
CUDA_DRIVER_LIB=
|
||||
|
||||
|
||||
CUDA_DRIVER_CPPFLAGS=
|
||||
CUDA_DRIVER_LDFLAGS=
|
||||
|
||||
# Check whether --with-cuda-driver was given.
|
||||
if test "${with_cuda_driver+set}" = set; then :
|
||||
withval=$with_cuda_driver;
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --with-cuda-driver-include was given.
|
||||
if test "${with_cuda_driver_include+set}" = set; then :
|
||||
withval=$with_cuda_driver_include;
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --with-cuda-driver-lib was given.
|
||||
if test "${with_cuda_driver_lib+set}" = set; then :
|
||||
withval=$with_cuda_driver_lib;
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
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.
|
||||
@ -15250,53 +15171,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"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include "cuda.h"
|
||||
int
|
||||
main ()
|
||||
{
|
||||
CUresult r = cuCtxPushCurrent (NULL);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
PLUGIN_NVPTX=1
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
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
|
||||
as_fn_error $? "CUDA driver package required for nvptx support" "$LINENO" 5
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
PLUGIN_NVPTX=1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@ -15362,14 +15237,6 @@ else
|
||||
PLUGIN_NVPTX_FALSE=
|
||||
fi
|
||||
|
||||
if test $PLUGIN_NVPTX_DYNAMIC = 1; then
|
||||
PLUGIN_NVPTX_DYNAMIC_TRUE=
|
||||
PLUGIN_NVPTX_DYNAMIC_FALSE='#'
|
||||
else
|
||||
PLUGIN_NVPTX_DYNAMIC_TRUE='#'
|
||||
PLUGIN_NVPTX_DYNAMIC_FALSE=
|
||||
fi
|
||||
|
||||
if test $PLUGIN_GCN = 1; then
|
||||
PLUGIN_GCN_TRUE=
|
||||
PLUGIN_GCN_FALSE='#'
|
||||
@ -17137,10 +17004,6 @@ if test -z "${PLUGIN_NVPTX_TRUE}" && test -z "${PLUGIN_NVPTX_FALSE}"; then
|
||||
as_fn_error $? "conditional \"PLUGIN_NVPTX\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${PLUGIN_NVPTX_DYNAMIC_TRUE}" && test -z "${PLUGIN_NVPTX_DYNAMIC_FALSE}"; then
|
||||
as_fn_error $? "conditional \"PLUGIN_NVPTX_DYNAMIC\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${PLUGIN_GCN_TRUE}" && test -z "${PLUGIN_GCN_FALSE}"; then
|
||||
as_fn_error $? "conditional \"PLUGIN_GCN\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
|
@ -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
|
||||
|
@ -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])
|
||||
|
@ -147,8 +147,6 @@ CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPU_COUNT = @CPU_COUNT@
|
||||
CUDA_DRIVER_INCLUDE = @CUDA_DRIVER_INCLUDE@
|
||||
CUDA_DRIVER_LIB = @CUDA_DRIVER_LIB@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
@ -210,9 +208,6 @@ PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PLUGIN_NVPTX_CPPFLAGS = @PLUGIN_NVPTX_CPPFLAGS@
|
||||
PLUGIN_NVPTX_LDFLAGS = @PLUGIN_NVPTX_LDFLAGS@
|
||||
PLUGIN_NVPTX_LIBS = @PLUGIN_NVPTX_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SECTION_LDFLAGS = @SECTION_LDFLAGS@
|
||||
SED = @SED@
|
||||
|
@ -190,19 +190,6 @@ proc libgomp_init { args } {
|
||||
append always_ld_library_path ":${atomic_library_path}"
|
||||
}
|
||||
}
|
||||
global cuda_driver_include
|
||||
global cuda_driver_lib
|
||||
if { $cuda_driver_include != "" } {
|
||||
# Stop gfortran from freaking out:
|
||||
# Warning: Nonexistent include directory "[...]"
|
||||
if {[file exists $cuda_driver_include]} {
|
||||
lappend ALWAYS_CFLAGS "additional_flags=-I$cuda_driver_include"
|
||||
}
|
||||
}
|
||||
if { $cuda_driver_lib != "" } {
|
||||
lappend ALWAYS_CFLAGS "additional_flags=-L$cuda_driver_lib"
|
||||
append always_ld_library_path ":$cuda_driver_lib"
|
||||
}
|
||||
}
|
||||
|
||||
# We use atomic operations in the testcases to validate results.
|
||||
|
@ -1,5 +1,2 @@
|
||||
set cuda_driver_include "@CUDA_DRIVER_INCLUDE@"
|
||||
set cuda_driver_lib "@CUDA_DRIVER_LIB@"
|
||||
|
||||
set offload_plugins "@offload_plugins@"
|
||||
set offload_targets "@offload_targets@"
|
||||
|
Loading…
Reference in New Issue
Block a user