[nvptx] Update insufficient launch message for variable vector_length
authorTom de Vries <tdevries@suse.de>
Sat, 12 Jan 2019 22:18:00 +0000 (22:18 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Sat, 12 Jan 2019 22:18:00 +0000 (22:18 +0000)
Update message in nvptx libgomp plugin about insufficient resources to launch
kernel, to accommodate for the fact the vector_length can now be variable.

2019-01-12  Tom de Vries  <tdevries@suse.de>

* plugin/plugin-nvptx.c (nvptx_exec): Update insufficient hardware
resources diagnostic.

From-SVN: r267890

libgomp/ChangeLog
libgomp/plugin/plugin-nvptx.c

index dce5dcedf57d2e41814f910bbea137005ae5e834..e08416ccc2d347f93bd4cd4ee9c8e29bf8488233 100644 (file)
@@ -1,3 +1,8 @@
+2019-01-12  Tom de Vries  <tdevries@suse.de>
+
+       * plugin/plugin-nvptx.c (nvptx_exec): Update insufficient hardware
+       resources diagnostic.
+
 2019-01-12  Tom de Vries  <tdevries@suse.de>
 
        * testsuite/libgomp.oacc-c-c++-common/vector-length-128-1.c: Expect
index c80da64c42251c72dd3c35e7b2f4d0d7d8699d0b..8912660966ab80f99abea370761a26a36cfb7887 100644 (file)
@@ -1297,14 +1297,16 @@ nvptx_exec (void (*fn), size_t mapnum, void **hostaddrs, void **devaddrs,
   if (dims[GOMP_DIM_WORKER] * dims[GOMP_DIM_VECTOR]
       > targ_fn->max_threads_per_block)
     {
-      int suggest_workers
-       = targ_fn->max_threads_per_block / dims[GOMP_DIM_VECTOR];
-      GOMP_PLUGIN_fatal ("The Nvidia accelerator has insufficient resources to"
-                        " launch '%s' with num_workers = %d; recompile the"
-                        " program with 'num_workers = %d' on that offloaded"
-                        " region or '-fopenacc-dim=:%d'",
-                        targ_fn->launch->fn, dims[GOMP_DIM_WORKER],
-                        suggest_workers, suggest_workers);
+      const char *msg
+       = ("The Nvidia accelerator has insufficient resources to launch '%s'"
+          " with num_workers = %d and vector_length = %d"
+          "; "
+          "recompile the program with 'num_workers = x and vector_length = y'"
+          " on that offloaded region or '-fopenacc-dim=:x:y' where"
+          " x * y <= %d"
+          ".\n");
+      GOMP_PLUGIN_fatal (msg, targ_fn->launch->fn, dims[GOMP_DIM_WORKER],
+                        dims[GOMP_DIM_VECTOR], targ_fn->max_threads_per_block);
     }
 
   /* Check if the accelerator has sufficient barrier resources to