]> gcc.gnu.org Git - gcc.git/commit
nvptx/mkoffload.cc: Warn instead of error when reverse offload is not possible
authorTobias Burnus <tobias@codesourcery.com>
Mon, 12 Sep 2022 13:25:13 +0000 (15:25 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 12 Sep 2022 13:25:13 +0000 (15:25 +0200)
commit6b43f556f392a7165582aca36a19fe7389d995b2
tree7823adb3d376ebb0d0c71a3177ee2def6f861c94
parent06b30eecdd9822842a0ff21548ab92f01adb2795
nvptx/mkoffload.cc: Warn instead of error when reverse offload is not possible

Reverse offload requests at least -misa=sm_35; with this patch, a warning
instead of an error is shown, still permitting reverse offload for all
other configured device types. This is achieved by not calling
GOMP_offload_register_ver (and stopping generating pointless 'static const char'
variables, once known.)

The tool_name as progname changes adds "nvptx " and "gcn " to the
"mkoffload: warning/error:" diagnostic.

gcc/ChangeLog:

* config/nvptx/mkoffload.cc (process): Replace a fatal_error by
a warning + not enabling offloading if -misa=sm_30 prevents
reverse offload.
(main): Use tool_name as progname for diagnostic.
* config/gcn/mkoffload.cc (main): Likewise.

libgomp/ChangeLog:

* libgomp.texi (Offload-Target Specifics: nvptx): Document
that reverse offload requires >= -march=sm_35.
* testsuite/libgomp.c-c++-common/requires-4.c: Build for nvptx
with -misa=sm_35.
* testsuite/libgomp.c-c++-common/requires-5.c: Likewise.
* testsuite/libgomp.c-c++-common/requires-6.c: Likewise.
* testsuite/libgomp.c-c++-common/reverse-offload-1.c: Likewise.
* testsuite/libgomp.fortran/reverse-offload-1.f90: Likewise.
* testsuite/libgomp.c/reverse-offload-sm30.c: New test.
gcc/config/gcn/mkoffload.cc
gcc/config/nvptx/mkoffload.cc
libgomp/libgomp.texi
libgomp/testsuite/libgomp.c-c++-common/requires-4.c
libgomp/testsuite/libgomp.c-c++-common/requires-5.c
libgomp/testsuite/libgomp.c-c++-common/requires-6.c
libgomp/testsuite/libgomp.c-c++-common/reverse-offload-1.c
libgomp/testsuite/libgomp.c/reverse-offload-sm30.c [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/reverse-offload-1.f90
This page took 0.06272 seconds and 5 git commands to generate.