summaryrefslogtreecommitdiff
path: root/libgomp/plugin/plugin-nvptx.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2017-07-31 14:43:24 +0200
committerMartin Jambor <mjambor@suse.cz>2017-07-31 14:43:24 +0200
commitb32f12dece884f1fa0f04c643a77105aff6ce8bc (patch)
treecdab5f10806561fc198f907299b0e55eb5701ef0 /libgomp/plugin/plugin-nvptx.c
parent166bec868d991fdf71f9a66f994e5977fcab4aa2 (diff)
parenta168a775e93ec31ae743ad282d8e60fa1c116891 (diff)
downloadgcc-b32f12dece884f1fa0f04c643a77105aff6ce8bc.tar.gz
Merge branch 'master' into gcngcn
Diffstat (limited to 'libgomp/plugin/plugin-nvptx.c')
-rw-r--r--libgomp/plugin/plugin-nvptx.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index 0e1b3e2d4f3..71630b57355 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -867,6 +867,14 @@ nvptx_get_num_devices (void)
return n;
}
+static void
+notify_var (const char *var_name, const char *env_var)
+{
+ if (env_var == NULL)
+ GOMP_PLUGIN_debug (0, "%s: <Not defined>\n", var_name);
+ else
+ GOMP_PLUGIN_debug (0, "%s: '%s'\n", var_name, env_var);
+}
static bool
link_ptx (CUmodule *module, const struct targ_ptx_obj *ptx_objs,
@@ -1089,10 +1097,12 @@ nvptx_exec (void (*fn), size_t mapnum, void **hostaddrs, void **devaddrs,
pthread_mutex_lock (&ptx_dev_lock);
if (!default_dims[0])
{
+ const char *var_name = "GOMP_OPENACC_DIM";
/* We only read the environment variable once. You can't
change it in the middle of execution. The syntax is
the same as for the -fopenacc-dim compilation option. */
- const char *env_var = getenv ("GOMP_OPENACC_DIM");
+ const char *env_var = getenv (var_name);
+ notify_var (var_name, env_var);
if (env_var)
{
const char *pos = env_var;