> As discussed earlier, I'd like to pass __OPENMP_TARGET__ argument to > all of GOMP_target{,_data,_update}, so that all those functions > can get at the offloading data section in the shared library or binary > making the call, so that the first time they encounter such a call > in the shared library or binary, it can attempt to actually offload > it to the target (and, if that fails, remember it, and do host fallback). Actually, I thought that that we'd perform loading the target code in gomp-initialization. So, first time libgomp is called, it loads target image (from somewhere) and starts the target-side MAIN on the target (which actually just starts to wait for offload requests). Then, when GOMP_target is called, it just passes address (or name, as it was initially) to this target-side MAIN and the target executes the requested function. I thought that at the moment GOMP_target is called everything is ready and loaded as initialization has been already executed. Isn't that correct? Maybe I misunderstood something - do you want to load target images only in GOMP_target, not earlier?
And I still not quite get it, how would target code know, which function to call in this scheme. How will it figure out, which function to call if we didn't even pass the function name? As far as I understand, __OPENMP_TARGET__ will lead to a dedicated section, which contains addresses of host-side versions of the functions. But how could we obtain the corresponding addresses for the target? COI, e.g., as I understand it, currently doesn't have a capability of returning target-side function address - it only could call a function by name. Or am I missing something? Thanks, Michael > Jakub