On Thu, Aug 25, 2022 at 04:54:51PM +0200, Tobias Burnus wrote: > Technically, this patch is stand alone, but conceptually it based on the > submitted but not reviewed patch: > "[Patch] OpenMP: Support reverse offload (middle end part)" > https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598662.html > > With that patch, for reverse offloads ('omp target device(ancestor:1)'), > calls like the following are added: > GOMP_target_ext (-2 /* initial device */, omp_fn.1 > where 'omp_fn.1' on nonhost devices a stub function just required for > looking up the host function pointer via the offload_funcs table. > > The attached patch prepare for reverse-offload device->host > function-address lookup by requesting (if needed) the on-device address. > > OK for mainline? > > Tobias > > > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 > München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas > Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht > München, HRB 106955
> libgomp: Prepare for reverse offload fn lookup > > Prepare for reverse-offloading function-pointer lookup by passing > a rev_fn_table argument to GOMP_OFFLOAD_load_image. > > The argument will be NULL, unless GOMP_REQUIRES_REVERSE_OFFLOAD is > requested and devices not supported it, are filtered out. > (Up to and including this commit, no non-host device claims such > support and the caller currently always passes NULL.) > > libgomp/ChangeLog: > > * libgomp-plugin.h (GOMP_OFFLOAD_load_image): Add > 'uint64_t **rev_fn_table' argument. > * oacc-host.c (host_load_image): Likewise. > * plugin/plugin-gcn.c (GOMP_OFFLOAD_load_image): Likewise; > currently unused. > * plugin/plugin-nvptx.c (GOMP_OFFLOAD_load_image): Likewise. > * target.c (gomp_load_image_to_device): Update call but pass > NULL for now. > > liboffloadmic/ChangeLog: > > * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_load_image): > Add (unused) uint64_t **rev_fn_table argument. Ok, thanks. Jakub