* [committed][nvptx, libgomp] Don't launch with num_workers == 0
@ 2019-01-09 0:09 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-09 0:09 UTC (permalink / raw)
To: gcc-patches; +Cc: Thomas Schwinge
Hi,
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.
Committed to trunk.
Thanks,
- Tom
[nvptx, libgomp] Don't launch with num_workers == 0
2019-01-08 Tom de Vries <tdevries@suse.de>
* plugin/plugin-nvptx.c (nvptx_exec): Make sure to launch with at least
one worker.
---
libgomp/plugin/plugin-nvptx.c | 1 +
1 file changed, 1 insertion(+)
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++)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-01-09 0:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 0:09 [committed][nvptx, libgomp] Don't launch with num_workers == 0 Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).