This is the mail archive of the
mailing list for the GCC project.
Re: Fwd: [RFC][gomp4] Offloading patches (2/3): Add tables generation
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: Ilya Verbin <iverbin at gmail dot com>, Thomas Schwinge <thomas at codesourcery dot com>, Richard Biener <rguenther at suse dot de>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Andrey Turetskiy <andrey dot turetskiy at gmail dot com>, Ilya Tocar <tocarip dot intel at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Nathan Sidwell <nathan_sidwell at mentor dot com>
- Date: Mon, 7 Jul 2014 17:14:27 +0200
- Subject: Re: Fwd: [RFC][gomp4] Offloading patches (2/3): Add tables generation
- Authentication-results: sourceware.org; auth=none
- References: <CADG=Z0HE6AudmZuQK2vWz+E4fh8PnqoJ-aq9GXjZXgn-ZRW0kw at mail dot gmail dot com> <5310B791 dot 1000703 at codesourcery dot com> <20140617182018 dot GA28422 at msticlxl57 dot ims dot intel dot com> <53A09586 dot 4060504 at codesourcery dot com> <20140618141341 dot GA35121 at msticlxl57 dot ims dot intel dot com> <53A1A0C2 dot 4000907 at codesourcery dot com> <20140619101902 dot GB35121 at msticlxl57 dot ims dot intel dot com> <53AD1E09 dot 4010803 at codesourcery dot com> <20140707145036 dot GA19896 at msticlxl57 dot ims dot intel dot com> <53BAB6AB dot 5000004 at codesourcery dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jul 07, 2014 at 05:03:07PM +0200, Bernd Schmidt wrote:
> On 07/07/2014 04:50 PM, Ilya Verbin wrote:
> >2) Or should I build accel compiler as a cross from
> >x86_64-pc-linux-gnu to x86_64-intelmic-linux-gnu?
> Yes, that's the general idea.
> >Will it help to distinguish the libs?
> Is libgomp the only problematic one? (Does the accel compiler even need
> one?) It seems to be installed in /usr/lib rather than in a gcc-specific
> directory, which is a little surprising to me. It may be necessary to give
> the accel compiler a different sysroot to avoid library clashes.
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.
And yes, you need libgomp for the offloading targets, because at least in
OpenMP you can call lots of omp_* functions in the target regions, and can
use most of the #pragma omp * directives that actually need to have runtime
support too. For offloading targets where you right now can't link stuff
I'm afraid you'll need to inline the parts of libgomp compiled for the PTX
(or HSAIL) targets manually during compilation (but what do you do for math
library functions, C functions etc.)?