Fwd: [RFC][gomp4] Offloading patches (2/3): Add tables generation

Jakub Jelinek jakub@redhat.com
Mon Jul 7 15:22:00 GMT 2014


On Mon, Jul 07, 2014 at 05:14:27PM +0200, Jakub Jelinek wrote:
> We need a libgomp for the offload targets to be different from the host
> libgomp even on targets like mic, because there are various omp_* functions
> that should behave differently.  Or the host libgomp needs to have a way how
> to query whether it is invoked as offloading target library.
> At least omp_is_default_device should return 0 when invoked inside of the
> offloaded program (but, note that e.g. sshing into Intel MIC and running
> there a program linked against -lgomp should return 1, because in that
> case the MIC is the host device).
> Other than that single function, I think on MIC/HSAIL that is the only thing
> that needs to change, for PTX where you supposedly want to support more than
> one team it is also the omp_get_num_teams and omp_get_team_num functions.

E.g. to use the same libgomp.so the solution could be for mkoffload to add
omp_is_default_device and omp_is_default_device_ functions to the binary,
where it will therefore override the symbol from libgomp.so.

	Jakub



More information about the Gcc-patches mailing list