aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2019-01-09 00:07:45 +0000
committerTom de Vries <tdevries@suse.de>2019-01-09 00:07:45 +0000
commitc5cf0e71fbf9fd7afdabed0245d8b3426d95e74c (patch)
tree05b0f1581a5c4df9e429111e829aa160e0fab069 /libgomp
parent39ae25901784091eaebea4a01b3ece20381fe1b7 (diff)
[nvptx, libgomp] Don't launch with num_workers == 0
When using a compiler build with: ... +#define PTX_DEFAULT_VECTOR_LENGTH PTX_CTA_SIZE +#define PTX_MAX_VECTOR_LENGTH PTX_CTA_SIZE ... and running the libgomp testsuite, we run into an execution failure in parallel-loop-1.c, due to a cuda launch failure: ... nvptx_exec: kernel f6_none_none$_omp_fn$0: launch gangs=480, workers=0, \ vectors=1024 libgomp: cuLaunchKernel error: invalid argument ... because workers == 0. The workers variable is set to 0 here in nvptx_exec: ... workers = blocks / actual_vectors; ... because actual_vectors is 1024, and blocks is 768: ... cuOccupancyMaxPotentialBlockSize: grid = 10, block = 768 ... Fix this by ensuring that workers is at least one. 2019-01-09 Tom de Vries <tdevries@suse.de> * plugin/plugin-nvptx.c (nvptx_exec): Make sure to launch with at least one worker. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@267746 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/plugin/plugin-nvptx.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 120f0874b27..fba0ba0562a 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-09 Tom de Vries <tdevries@suse.de>
+
+ * plugin/plugin-nvptx.c (nvptx_exec): Make sure to launch with at least
+ one worker.
+
2019-01-07 Tom de Vries <tdevries@suse.de>
* testsuite/libgomp.oacc-c-c++-common/vector-length-128-3.c: Fix
diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index 572d9ef8d5c..60553bdf3bd 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -1272,6 +1272,7 @@ nvptx_exec (void (*fn), size_t mapnum, void **hostaddrs, void **devaddrs,
? vectors
: dims[GOMP_DIM_VECTOR]);
workers = blocks / actual_vectors;
+ workers = MAX (workers, 1);
}
for (i = 0; i != GOMP_DIM_MAX; i++)