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

2016-11-28 Thread Alexander Monakov
> > 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

(I was mistaken here - musl libc does provide pthread_.*affinity_np entrypoints)

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

Applied as svn rev. 242918 and then deleted critical.c in the next commit.

Thanks.
Alexander


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

2016-11-28 Thread Jakub Jelinek
On Mon, Nov 28, 2016 at 03:50:54PM +0300, Alexander Monakov wrote:
> > * 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?

Yes, thanks.

If you could also replace the intentionally empty files in config/nvptx/
with
/* Nothing needed.  */
comment as confirmation that those are really meant to be empty, it would
be appreciated.

Jakub


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

2016-11-28 Thread Hahnfeld, Jonas
> -Original Message-
> From: Alexander Monakov [mailto:amona...@ispras.ru]
> Sent: Monday, November 28, 2016 1:51 PM
> To: Hahnfeld, Jonas
> Cc: gcc-patches@gcc.gnu.org; Jakub Jelinek (ja...@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 <hahnf...@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..000


smime.p7s
Description: S/MIME cryptographic signature


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

2016-11-28 Thread Alexander Monakov
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 
> 
>   * 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.


>   * 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?

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..000


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

2016-11-28 Thread Hahnfeld, Jonas
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.

Kind regards,
Jonas

--
Jonas Hahnfeld, MATSE-Auszubildender

IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074  Aachen (Germany)
hahnf...@itc.rwth-aachen.de
www.itc.rwth-aachen.de




0001-Fix-OpenMP-offloading-to-NVPTX-and-correct-location-.patch
Description: Binary data


smime.p7s
Description: S/MIME cryptographic signature