aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2015-02-11 15:15:28 +0100
committerThomas Schwinge <tschwinge@gcc.gnu.org>2015-02-11 15:15:28 +0100
commite6f229ca44a659713b015ea0b653b5e7f9354a48 (patch)
tree1329d7440ca9772834be13889cf6a80df3a4b184 /gcc
parenta8d790dfc0f78bce8259e792c2c3502712d866dc (diff)
downloadgcc-e6f229ca44a659713b015ea0b653b5e7f9354a48.zip
gcc-e6f229ca44a659713b015ea0b653b5e7f9354a48.tar.gz
gcc-e6f229ca44a659713b015ea0b653b5e7f9354a48.tar.bz2
nvptx mkoffload: Don't hard-code GOMP_DEVICE_NVIDIA_PTX.
gcc/ * config/nvptx/mkoffload.c: Include "gomp-constants.h". (process): Use its GOMP_DEVICE_NVIDIA_PTX instead of (wrongly) hard-coding PTX_ID. From-SVN: r220619
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/nvptx/mkoffload.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2fa7ff2..1479dcb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-11 Thomas Schwinge <thomas@codesourcery.com>
+
+ * config/nvptx/mkoffload.c: Include "gomp-constants.h".
+ (process): Use its GOMP_DEVICE_NVIDIA_PTX instead of (wrongly)
+ hard-coding PTX_ID.
+
2015-02-11 H.J. Lu <hongjiu.lu@intel.com>
* doc/sourcebuild.texi (pie_enabled): Document.
diff --git a/gcc/config/nvptx/mkoffload.c b/gcc/config/nvptx/mkoffload.c
index 38ccdba..8f359cf 100644
--- a/gcc/config/nvptx/mkoffload.c
+++ b/gcc/config/nvptx/mkoffload.c
@@ -35,6 +35,7 @@
#include "obstack.h"
#include "diagnostic-core.h"
#include "collect-utils.h"
+#include "gomp-constants.h"
const char tool_name[] = "nvptx mkoffload";
@@ -791,9 +792,9 @@ process (FILE *in, FILE *out)
fprintf (out, "extern void GOMP_offload_register (const void *, int, void *);\n");
fprintf (out, "extern void *__OPENMP_TARGET__[];\n\n");
- fprintf (out, "#define PTX_ID 1\n");
fprintf (out, "static __attribute__((constructor)) void init (void)\n{\n");
- fprintf (out, " GOMP_offload_register (__OPENMP_TARGET__, PTX_ID,\n");
+ fprintf (out, " GOMP_offload_register (__OPENMP_TARGET__, %d,\n",
+ GOMP_DEVICE_NVIDIA_PTX);
fprintf (out, " &target_data);\n");
fprintf (out, "};\n");
}