]> git.ipfire.org Git - thirdparty/gcc.git/commit
[nvptx, libgomp] Don't launch with num_workers == 0
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Jan 2019 00:07:45 +0000 (00:07 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Jan 2019 00:07:45 +0000 (00:07 +0000)
commitbb4945b2dc4991b79fe86299b9083c231cc18db6
tree05b0f1581a5c4df9e429111e829aa160e0fab069
parentf81232c1269c70864309c4714d8caa6e925a18ff
[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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267746 138bc75d-0d04-0410-961f-82ee72b054a4
libgomp/ChangeLog
libgomp/plugin/plugin-nvptx.c