nvptx: libgomp+mkoffload.cc: Prepare for reverse offload fn lookup
authorTobias Burnus <tobias@codesourcery.com>
Fri, 9 Sep 2022 15:58:02 +0000 (17:58 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 9 Sep 2022 15:58:02 +0000 (17:58 +0200)
commit50be486dff4ea2676ed022e9524ef190b92ae2b1
tree80a2284eb384c36807a1484f2ac670152422ab11
parentdfd75bf7e9017e92b59be650fca97d2b4b331a82
nvptx: libgomp+mkoffload.cc: Prepare for reverse offload fn lookup

Add support to nvptx for reverse lookup of function name to prepare for
'omp target device(ancestor:1)'.

gcc/ChangeLog:

* config/nvptx/mkoffload.cc (struct id_map): Add 'dim' member.
(record_id): Store func name without quotes, store dim separately.
(process): For GOMP_REQUIRES_REVERSE_OFFLOAD, check that -march is
at least sm_35, create '$offload_func_table' global array and init
with reverse-offload function addresses.
* config/nvptx/nvptx.cc (write_fn_proto_1, write_fn_proto): New
force_public attribute to force .visible.
(nvptx_declare_function_name): For "omp target
device_ancestor_nohost" attribut, force .visible/TREE_PUBLIC.

libgomp/ChangeLog:

* plugin/plugin-nvptx.c (GOMP_OFFLOAD_load_image): Read offload
function address table '$offload_func_table' if rev_fn_table
is not NULL.
gcc/config/nvptx/mkoffload.cc
gcc/config/nvptx/nvptx.cc
libgomp/plugin/plugin-nvptx.c