Slightly revised version, fixing some issues in mkoffload.cc. Otherwise, the same applies: On 25.08.22 19:30, Tobias Burnus wrote: On 25.08.22 16:54, Tobias Burnus wrote: The attached patch prepare for reverse-offload device->host function-address lookup by requesting (if needed) the on-device address. This patch adds the actual implementation for NVPTX. Having array[] = {fn1,fn2}; works with nvptx only since sm_35; hence, if there is a reverse_offload and sm_30 is used, there will be a compile-time error. To avoid incompatibilities, I compile with the same PTX ISA .version and sm_XX version as the (last) file that contains the reverse offload. While it should not matter, some newer CUDA might not support, e.g., sm_35 or do not like a specific ISA version - thus, that seemed to be safer. This is currently effectively a no op as with [1/3] patch, always NULL is passed and as GOMP_OFFLOAD_get_num_devices returns <= 0 as soon as 'omp requires reverse_offload' has been specified. 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