Jakub Jelinek wrote: > So firstprivate clause handling remaps them then if declare target indirect > is used? If so, the patch looks reasonable to me. [I have now updated the patch to turn the testcase to ensure that is also keeps works at runtime.] OpenMP leaves it a bit open when the remapping has to happen, but one can construct cases – in particular with unified-shared memory – where it is not possible to do this upon entry to a target region. Thus, it has to be done when the function is invoked, e.g. i = (*g) (); is turned (in the target region but only on the device side) into i = (*GOMP_target_map_indirect_ptr (g)) (); Thus, as long as the host pointer value is transferred to the device, it works – as the lookup is done on the device side. Directly using a device address (remap when mapping to the target) will also not shorten the lookup, i.e. there is no need for it. Does it still look reasonable to you? Tobias PS: The current OpenMP specification, it is listed mainly described via the glossary (newest change is the addition of dummy procedure): "indirect device invocation – An indirect call to the _device_ version of a _procedure_ on a _device_ other than the _host-device_, through a function pointer (C/C++), a pointer to a member function (C++), a dummy procedure (Fortran), or a procedure pointer (Fortran) that refers to the host version of the _procedure_."