[2/9,nvptx] Update insufficient launch message for variable vector_length

Message ID 20190112222131.29519-3-tdevries@suse.de
State New
Headers show
Series
  • Add support for warp-multiple openacc vector length
Related show

Commit Message

Tom de Vries Jan. 12, 2019, 10:21 p.m.
Update message in nvptx libgomp plugin about insufficient resources to launch
kernel, to accommodate for the fact the vector_length can now be variable.

19-01-08  Tom de Vries  <tdevries@suse.de>

	* plugin/plugin-nvptx.c (nvptx_exec): Update insufficient hardware
	resources diagnostic.
---
 libgomp/plugin/plugin-nvptx.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

-- 
2.16.4

Patch

diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index c80da64c422..8912660966a 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -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