[PATCH] Fix OpenMP offloading to NVPTX and correct location of

Hahnfeld, Jonas Hahnfeld@itc.rwth-aachen.de
Mon Nov 28 13:01:00 GMT 2016


> -----Original Message-----
> From: Alexander Monakov [mailto:amonakov@ispras.ru]
> Sent: Monday, November 28, 2016 1:51 PM
> To: Hahnfeld, Jonas
> Cc: gcc-patches@gcc.gnu.org; Jakub Jelinek (jakub@redhat.com)
> Subject: Re: [PATCH] Fix OpenMP offloading to NVPTX and correct location of
>
> On Mon, 28 Nov 2016, Hahnfeld, Jonas wrote:
> > Hi,
> >
> > find attached a patch that fixes OpenMP offloading to NVPTX for me.
> > Without the changes, I got errors from the linker for affinity symbols.
>
>
> > 2016-11-28  Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
> >
> > 	* config/linux/affinity.c: Include ../../affinity.c as fallback.
>
> Thanks.  This is in the #else branch of '#ifdef HAVE_PTHREAD_AFFINITY_NP'
> (so the ChangeLog entry should have [!HAVE_PTHREAD_AFFINITY_NP]) --
> I'm curious why you don't have this defined.  One reason I can think of is, 
> if
> you're building libgomp against musl libc, but libcuda.so has several 
> external
> symbols that can't be satisfied by musl (only glibc) -- so dynamic linking 
> of
> libgomp nvptx plugin will fail at runtime.

I have this defined and the problem never really occurred for me: It just came 
to my attention when grepping for affinity.c and looked wrong.

>
>
> > 	* config/nvptx/affinity.c: Delete to use fallback implementation.
>
> Right.  This file was (correctly) deleted on the branch, but I missed the
> deletion when writing the Changelog and then subsequently missed it again
> during svn checkin.  Sorry about this.  I've checked other files, and I see 
> that
> critical.c needs the same treatment, but the rest of files in
> libgomp/config/nvptx are in sync with the branch.
>
> Jakub, shall I apply this patch on Jonas' behalf, and then remove
> config/nvptx/critical.c separately?

I'm fine with any splitting or changes to my change as long as the problem is 
fixed in the end ;-)

Cheers,
Jonas

>
> Thanks.
> Alexander
>
> > ---
> >  libgomp/config/linux/affinity.c | 2 +-
> > libgomp/config/nvptx/affinity.c | 0
> >  2 files changed, 1 insertion(+), 1 deletion(-)  delete mode 100644
> > libgomp/config/nvptx/affinity.c
> >
> > diff --git a/libgomp/config/linux/affinity.c
> > b/libgomp/config/linux/affinity.c index ca6eec04..d8dede6 100644
> > --- a/libgomp/config/linux/affinity.c
> > +++ b/libgomp/config/linux/affinity.c
> > @@ -394,6 +394,6 @@ ialias(omp_get_place_proc_ids)
> >
> >  #else
> >
> > -#include "../posix/affinity.c"
> > +#include "../../affinity.c"
> >
> >  #endif
> > diff --git a/libgomp/config/nvptx/affinity.c
> > b/libgomp/config/nvptx/affinity.c deleted file mode 100644 index
> > e69de29..0000000
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5868 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161128/d6e13bc0/attachment.p7s>


More information about the Gcc-patches mailing list