libgomp nvptx plugin: Split 'PLUGIN_NVPTX_DYNAMIC' into 'PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H' and 'PLUGIN_NVPTX_LINK_LIBCUDA'
Including the GCC-shipped 'include/cuda/cuda.h' vs. system <cuda.h> and 'dlopen'ing the CUDA Driver library vs. linking it are separate concerns. libgomp/ * plugin/Makefrag.am: Handle 'PLUGIN_NVPTX_DYNAMIC'. * plugin/configfrag.ac (PLUGIN_NVPTX_DYNAMIC): Change 'AC_DEFINE_UNQUOTED' into 'AM_CONDITIONAL'. * plugin/plugin-nvptx.c: Split 'PLUGIN_NVPTX_DYNAMIC' into 'PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H' and 'PLUGIN_NVPTX_LINK_LIBCUDA'. * Makefile.in: Regenerate. * config.h.in: Likewise. * configure: Likewise.
This commit is contained in:
@@ -35,8 +35,22 @@ libgomp_plugin_nvptx_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_NVPTX_CPPFLAGS)
|
||||
libgomp_plugin_nvptx_la_LDFLAGS = $(libgomp_plugin_nvptx_version_info) \
|
||||
$(lt_host_flags)
|
||||
libgomp_plugin_nvptx_la_LDFLAGS += $(PLUGIN_NVPTX_LDFLAGS)
|
||||
libgomp_plugin_nvptx_la_LIBADD = libgomp.la $(PLUGIN_NVPTX_LIBS)
|
||||
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
|
||||
endif
|
||||
|
||||
# 'dlopen'ing the CUDA Driver library vs. linking it.
|
||||
if PLUGIN_NVPTX_DYNAMIC
|
||||
libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS)
|
||||
else
|
||||
libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_LINK_LIBCUDA
|
||||
libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
if PLUGIN_GCN
|
||||
|
||||
@@ -219,6 +219,5 @@ fi
|
||||
AC_DEFINE_UNQUOTED(OFFLOAD_PLUGINS, "$offload_plugins",
|
||||
[Define to offload plugins, separated by commas.])
|
||||
AM_CONDITIONAL([PLUGIN_NVPTX], [test $PLUGIN_NVPTX = 1])
|
||||
AC_DEFINE_UNQUOTED([PLUGIN_NVPTX_DYNAMIC], [$PLUGIN_NVPTX_DYNAMIC],
|
||||
[Define to 1 if the NVIDIA plugin should dlopen libcuda.so.1, 0 if it should be linked against it.])
|
||||
AM_CONDITIONAL([PLUGIN_NVPTX_DYNAMIC], [test $PLUGIN_NVPTX_DYNAMIC = 1])
|
||||
AM_CONDITIONAL([PLUGIN_GCN], [test $PLUGIN_GCN = 1])
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "oacc-int.h"
|
||||
|
||||
#include <pthread.h>
|
||||
#if PLUGIN_NVPTX_DYNAMIC
|
||||
#ifndef PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H
|
||||
# include "cuda/cuda.h"
|
||||
#else
|
||||
# include <cuda.h>
|
||||
@@ -85,7 +85,7 @@ CUresult cuOccupancyMaxPotentialBlockSize(int *, int *, CUfunction,
|
||||
|
||||
#define DO_PRAGMA(x) _Pragma (#x)
|
||||
|
||||
#if PLUGIN_NVPTX_DYNAMIC
|
||||
#ifndef PLUGIN_NVPTX_LINK_LIBCUDA
|
||||
# include <dlfcn.h>
|
||||
|
||||
struct cuda_lib_s {
|
||||
|
||||
Reference in New Issue
Block a user