]> gcc.gnu.org Git - gcc.git/commit
libgomp: Add no-target-region rev offload test + fix plugin-nvptx
authorTobias Burnus <tobias@codesourcery.com>
Fri, 25 Nov 2022 12:48:17 +0000 (13:48 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 25 Nov 2022 12:48:17 +0000 (13:48 +0100)
commit9f9d128f459e0c5ace8f7b85504d277b5a838daf
treec935998f0c1a3490cd5beec437d84a01ea14e0f3
parentc16e85d726a7793c05209af031dac0bebf035ab9
libgomp: Add no-target-region rev offload test + fix plugin-nvptx

OpenMP permits that a 'target device(ancestor:1)' is called without being
enclosed in a target region - using the current device (i.e. the host) in
that case.  This commit adds a testcase for this.

In case of nvptx, the missing on-device 'GOMP_target_ext' call causes that
it and also the associated on-device GOMP_REV_OFFLOAD_VAR variable are not
linked in from nvptx's libgomp.a. Thus, handle the failing cuModuleGetGlobal
gracefully by disabling reverse offload and assuming that the failure is fine.

libgomp/ChangeLog:

* plugin/plugin-nvptx.c (GOMP_OFFLOAD_load_image): Use unsigned int
for 'i' to match 'fn_entries'; regard absent GOMP_REV_OFFLOAD_VAR
as valid and the code having no reverse-offload code.
* testsuite/libgomp.c-c++-common/reverse-offload-2.c: New test.
libgomp/plugin/plugin-nvptx.c
libgomp/testsuite/libgomp.c-c++-common/reverse-offload-2.c [new file with mode: 0644]
This page took 0.058353 seconds and 5 git commands to generate.