diff mbox

[2/3] Introduce LIBGOMP_OFFLOADED_ONLY macro

Message ID alpine.LNX.2.20.13.1611302024490.9298@monopod.intra.ispras.ru
State New
Headers show

Commit Message

Alexander Monakov Nov. 30, 2016, 5:28 p.m. UTC
Introduce LIBGOMP_OFFLOADED_ONLY macro to indicate that libgomp is being built
for an accelerator-only target.

	* configure.ac [nvptx*-*-*] (libgomp_offloaded_only): Set and use it...
	(LIBGOMP_OFFLOADED_ONLY): ...here; new define.
	* configure: Regenerate.
	* config.h.in: Likewise.

Comments

Jakub Jelinek Nov. 30, 2016, 5:32 p.m. UTC | #1
On Wed, Nov 30, 2016 at 08:28:05PM +0300, Alexander Monakov wrote:
> Introduce LIBGOMP_OFFLOADED_ONLY macro to indicate that libgomp is being built
> for an accelerator-only target.
> 
> 	* configure.ac [nvptx*-*-*] (libgomp_offloaded_only): Set and use it...
> 	(LIBGOMP_OFFLOADED_ONLY): ...here; new define.
> 	* configure: Regenerate.
> 	* config.h.in: Likewise.

Ok.

	Jakub
diff mbox

Patch

diff --git a/libgomp/config.h.in b/libgomp/config.h.in
index b54dd87..583b9b4 100644
--- a/libgomp/config.h.in
+++ b/libgomp/config.h.in
@@ -115,6 +115,9 @@ 
 /* Define to 1 if GNU symbol versioning is used for libgomp. */
 #undef LIBGOMP_GNU_SYMBOL_VERSIONING
 
+/* Define to 1 if building libgomp for an accelerator-only target. */
+#undef LIBGOMP_OFFLOADED_ONLY
+
 /* Define to 1 if libgomp should use POSIX threads. */
 #undef LIBGOMP_USE_PTHREADS
 
diff --git a/libgomp/configure b/libgomp/configure
index cfce560..6355ad9 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -15074,6 +15074,8 @@  case "$host" in
   nvptx*-*-*)
     # NVPTX does not support Pthreads, has its own code replacement.
     libgomp_use_pthreads=no
+    # NVPTX is an accelerator-only target
+    libgomp_offloaded_only=yes
     ;;
   *)
     # Check to see if -pthread or -lpthread is needed.  Prefer the former.
@@ -15125,6 +15127,12 @@  $as_echo "#define LIBGOMP_USE_PTHREADS 1" >>confdefs.h
 
 fi
 
+if test x$libgomp_offloaded_only = xyes; then
+
+$as_echo "#define LIBGOMP_OFFLOADED_ONLY 1" >>confdefs.h
+
+fi
+
 # Plugins for offload execution, configure.ac fragment.  -*- mode: autoconf -*-
 #
 # Copyright (C) 2014-2016 Free Software Foundation, Inc.
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index 5f1db7e..4086d3f 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -182,6 +182,8 @@  case "$host" in
   nvptx*-*-*)
     # NVPTX does not support Pthreads, has its own code replacement.
     libgomp_use_pthreads=no
+    # NVPTX is an accelerator-only target
+    libgomp_offloaded_only=yes
     ;;
   *)
     # Check to see if -pthread or -lpthread is needed.  Prefer the former.
@@ -208,6 +210,11 @@  if test x$libgomp_use_pthreads != xno; then
             [Define to 1 if libgomp should use POSIX threads.])
 fi
 
+if test x$libgomp_offloaded_only = xyes; then
+  AC_DEFINE(LIBGOMP_OFFLOADED_ONLY, 1,
+            [Define to 1 if building libgomp for an accelerator-only target.])
+fi
+
 m4_include([plugin/configfrag.ac])
 
 # Check for functions needed.