This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Ping^2 Re: Pass -foffload targets from driver to libgomp at link time
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Bernd Schmidt <bschmidt at redhat dot com>, gcc-patches at gcc dot gnu dot org, thomas at codesourcery dot com, Nathan Sidwell <nathan at codesourcery dot com>
- Date: Fri, 11 Sep 2015 17:43:49 +0200
- Subject: Re: Ping^2 Re: Pass -foffload targets from driver to libgomp at link time
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1508272043510 dot 20506 at digraph dot polyomino dot org dot uk> <alpine dot DEB dot 2 dot 10 dot 1509031452340 dot 13579 at digraph dot polyomino dot org dot uk> <alpine dot DEB dot 2 dot 10 dot 1509101340500 dot 30058 at digraph dot polyomino dot org dot uk> <55F18D87 dot 6070208 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1509111318520 dot 11676 at digraph dot polyomino dot org dot uk> <55F2E935 dot 7010300 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1509111525030 dot 11676 at digraph dot polyomino dot org dot uk>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Sep 11, 2015 at 03:26:04PM +0000, Joseph Myers wrote:
> On Fri, 11 Sep 2015, Bernd Schmidt wrote:
>
> > I expect you know best what to do in the OpenACC testsuite driver, but you
> > might want to run the libgomp.exp parts by Jakub. If the testsuite parts are
> > independent of the rest of the patch, please repost them separately.
>
> Jakub? The testsuite changes and the rest of the patch depend on each
> other.
So, do I understand well that you'll call GOMP_set_offload_targets from
constructs of all shared libraries (and the binary) that contain offloaded
code? If yes, that is surely going to fail the assertions in there.
You can dlopen such libraries etc. What if you link one library with
-fopenmp=nvptx-none and another one with -fopenmp=x86_64-intelmicemul-linux?
Can't the -foffload= string be passed to GOMP_offload_register_ver
(or just derive the list of plugins that should be loaded or at least those
that should be tried first from the list of offloaded data that has been
registered so far)?
I mean, it is also very well possible some program calls omp_get_num_devices
() etc. say from main binary and only then dlopens shared libraries that
contain offloaded regions and then attempt to offload in those shared
libraries. So, better it should always load all possible plugins, but
perhaps in order determined by what has been registered?
Jakub