[libgomp, testsuite] Fix insufficient resources in test-cases
authorTom de Vries <tdevries@suse.de>
Sun, 23 Jan 2022 05:29:58 +0000 (06:29 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 1 Feb 2022 07:15:00 +0000 (08:15 +0100)
commitd43fbc7d3f7621e1c8f153c1471d2a5cd20bfdc8
treede90383618e442099bccbe4f1be08c2a89ed9099
parentbe362d5e127e087dcd4a2c0d843cf7b9a7399c73
[libgomp, testsuite] Fix insufficient resources in test-cases

When running libgomp test-case broadcast-many.c on an nvptx accelerator
(T400, driver version 470.86), I run into:
...
libgomp: The Nvidia accelerator has insufficient resources to launch \
  'main$_omp_fn$0' with num_workers = 32 and vector_length = 32; \
  recompile the program with 'num_workers = x and vector_length = y' on \
  that offloaded region or '-fopenacc-dim=:x:y' where x * y <= 896.

FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/broadcast-many.c \
  -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none  \
  -O0  execution test
...

The error does not occur when using GOMP_NVPTX_JIT=-O0.

Fix this by using 896 / 32 == 28 workers for ACC_DEVICE_TYPE_nvidia.

Likewise for some other test-cases.

Tested libgomp on x86_64 with nvptx accelerator.

libgomp/ChangeLog:

2022-01-27  Tom de Vries  <tdevries@suse.de>

* testsuite/libgomp.oacc-c-c++-common/broadcast-many.c: Reduce
num_workers for nvidia accelerator to fix libgomp error 'insufficient
resources'.
* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c:
Same.
* testsuite/libgomp.oacc-c-c++-common/reduction-7.c: Same.
libgomp/testsuite/libgomp.oacc-c-c++-common/broadcast-many.c
libgomp/testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c
libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-7.c