diff mbox

OpenACC middle end changes

Message ID 87mw6lrvrf.fsf@schwinge.name
State New
Headers show

Commit Message

Thomas Schwinge Dec. 18, 2014, 12:24 p.m. UTC
Hi Jakub!

On Thu, 18 Dec 2014 13:15:38 +0100, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Dec 18, 2014 at 01:02:22PM +0100, Jakub Jelinek wrote:
> > On Thu, Dec 18, 2014 at 12:38:53PM +0100, Jakub Jelinek wrote:
> > > So, is what is on the gomp-4_0-branch now all that you'd like to merge to
> > > trunk now?

Basically, yes.  Only "basically", because there are still a few
unaddressed review issues in the front ends -- which I'll look into now.
(Meaning really: now.)  :-)


Doing the "merge" as one big commit on trunk will be the easiest
approach, of course.  Is that OK, or is there any requirement to single
out any of the changes, such as the
libgomp/testsuite/libgomp-test-support.exp file just discussed, or the
libgomp »Offloading and Multi Processing Runtime Library« renaming, or
anything else?


> > > Has it been tested on nvptx?

I have always been testing on gomp-4_0-branch with ACC_DEVICE_TYPE=host
and ACC_DEVICE_TYPE=host_nonshm, plus with ACC_DEVICE_TYPE=nvidia in an
internal branch.  This branch corresponds to gomp-4_0-branch, but also
includes a few patches related to offloading that Bernd has posted for
trunk approval, but has not yet gotten approved.


> > > I guess we should test it with
> > > XeonPhi offloading too to make sure it doesn't break.

Right.  Do you happen to be set up for such testing?  I have not yet
managed to properly change my build/test scripts for
x86_64-intelmicemul-linux-gnu.


> > > And then you or together with your coworkers should write the summary
> > > ChangeLogs (i.e. what changed compared to trunk in a single giant entry
> > > for each ChangeLog file as opposed to many ChangeLog.gomp change entries).

Right, I'll do that once it's time to merge -- otherwise it'll be too
cumbersome to keep those up to date.


> > Also, it would be nice to update wiki/Offloading to give details on all the
> > steps how to configure nvptx offloading (how to grab nvptx-newlib,
> > nvptx-tools, how to configure nvptx-none compiler, in what order to build
> > those etc.).

Right.


> FYI, just tried to build gomp-4_0-branch with:
> ../configure --build=x86_64-intelmicemul-linux-gnu --host=x86_64-intelmicemul-linux-gnu --target=x86_64-intelmicemul-linux-gnu --enable-as-accelerator-for=x86_64-pc-linux-gnu --disable-bootstrap
> make -j16
> and the build failed with:
> ../../gcc/builtins.c: In function ‘rtx_def* expand_builtin_acc_on_device(tree, rtx)’:
> ../../gcc/builtins.c:5904:17: error: ‘ACCEL_COMPILER_acc_device’ was not declared in this scope
>    v2 = GEN_INT (ACCEL_COMPILER_acc_device);
>                  ^
> ../../gcc/rtl.h:3186:51: note: in definition of macro ‘GEN_INT’
>  #define GEN_INT(N)  gen_rtx_CONST_INT (VOIDmode, (N))
>                                                    ^
> 
> Where is ACCEL_COMPILER_acc_device macro supposed to be defined?

From b6781092de7cc9fc8c24600815e0a1223e1241f5 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 17 Dec 2014 10:10:53 +0100
Subject: [PATCH] Intel MIC offloading.

---
 gcc/config.gcc                     |  1 +
 gcc/config/i386/intelmic-offload.h | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 gcc/config/i386/intelmic-offload.h

Comments

Jakub Jelinek Dec. 18, 2014, 12:31 p.m. UTC | #1
On Thu, Dec 18, 2014 at 01:24:20PM +0100, Thomas Schwinge wrote:
> Hi Jakub!
> 
> On Thu, 18 Dec 2014 13:15:38 +0100, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Thu, Dec 18, 2014 at 01:02:22PM +0100, Jakub Jelinek wrote:
> > > On Thu, Dec 18, 2014 at 12:38:53PM +0100, Jakub Jelinek wrote:
> > > > So, is what is on the gomp-4_0-branch now all that you'd like to merge to
> > > > trunk now?
> 
> Basically, yes.  Only "basically", because there are still a few
> unaddressed review issues in the front ends -- which I'll look into now.
> (Meaning really: now.)  :-)
> 
> 
> Doing the "merge" as one big commit on trunk will be the easiest
> approach, of course.  Is that OK, or is there any requirement to single
> out any of the changes, such as the
> libgomp/testsuite/libgomp-test-support.exp file just discussed, or the
> libgomp »Offloading and Multi Processing Runtime Library« renaming, or
> anything else?

Doing one big merge is ok with me.  If one needs to bisect something, they
can look at the gomp-4_0-branch.

> > > > Has it been tested on nvptx?
> 
> I have always been testing on gomp-4_0-branch with ACC_DEVICE_TYPE=host
> and ACC_DEVICE_TYPE=host_nonshm, plus with ACC_DEVICE_TYPE=nvidia in an
> internal branch.  This branch corresponds to gomp-4_0-branch, but also
> includes a few patches related to offloading that Bernd has posted for
> trunk approval, but has not yet gotten approved.

Do you have a list of them (URLs)?  Have they been pinged?
Are they show stoppers for the offloading, or just some tests fail because
of that?

> > > > I guess we should test it with
> > > > XeonPhi offloading too to make sure it doesn't break.
> 
> Right.  Do you happen to be set up for such testing?  I have not yet
> managed to properly change my build/test scripts for
> x86_64-intelmicemul-linux-gnu.

Anyone with x86_64-linux should be able to test that (i.e. the emulation),
for real offloading (that ix x86_64-intelmic-linux-gnu) you supposedly need
2 libraries, some kernel module, some distro installed on the offloading
device and most importantly the hw.

> --- gcc/config.gcc
> +++ gcc/config.gcc
> @@ -2906,6 +2906,7 @@ esac
>  case ${target} in
>  *-intelmic-* | *-intelmicemul-*)
>  	tmake_file="${tmake_file} i386/t-intelmic"
> +	tm_file="${tm_file} i386/intelmic-offload.h"
>  	;;
>  esac
>  
> diff --git gcc/config/i386/intelmic-offload.h gcc/config/i386/intelmic-offload.h
> new file mode 100644
> index 0000000..dc346c7
> --- /dev/null
> +++ gcc/config/i386/intelmic-offload.h
> @@ -0,0 +1,35 @@
> +/* Definitions for Intel MIC offloading.
> +
> +   Copyright (C) 2014 Free Software Foundation, Inc.
> +
> +   This file is part of GCC.
> +
> +   GCC is free software; you can redistribute it and/or modify
> +   it under the terms of the GNU General Public License as published by
> +   the Free Software Foundation; either version 3, or (at your option)
> +   any later version.
> +
> +   GCC is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +   GNU General Public License for more details.
> +
> +   Under Section 7 of GPL version 3, you are granted additional
> +   permissions described in the GCC Runtime Library Exception, version
> +   3.1, as published by the Free Software Foundation.
> +
> +   You should have received a copy of the GNU General Public License and
> +   a copy of the GCC Runtime Library Exception along with this program;
> +   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> +   <http://www.gnu.org/licenses/>.  */
> +
> +#ifndef INTELMIC_OFFLOAD_H
> +#define INTELMIC_OFFLOAD_H
> +
> +/* Support for OpenACC acc_on_device.  */
> +
> +#include "gomp-constants.h"
> +
> +#define ACCEL_COMPILER_acc_device GOMP_DEVICE_INTEL_MIC
> +
> +#endif

LGTM.

	Jakub
Jakub Jelinek Dec. 18, 2014, 12:36 p.m. UTC | #2
On Thu, Dec 18, 2014 at 01:31:45PM +0100, Jakub Jelinek wrote:
> > --- gcc/config.gcc
> > +++ gcc/config.gcc
> > @@ -2906,6 +2906,7 @@ esac
> >  case ${target} in
> >  *-intelmic-* | *-intelmicemul-*)
> >  	tmake_file="${tmake_file} i386/t-intelmic"
> > +	tm_file="${tm_file} i386/intelmic-offload.h"
> >  	;;
> >  esac
> >  
> > +#define ACCEL_COMPILER_acc_device GOMP_DEVICE_INTEL_MIC
> > +
> > +#endif

Oh, and where is this defined for nvptx-none target?

	Jakub
diff mbox

Patch

diff --git gcc/config.gcc gcc/config.gcc
index 8541274..faad47d 100644
--- gcc/config.gcc
+++ gcc/config.gcc
@@ -2906,6 +2906,7 @@  esac
 case ${target} in
 *-intelmic-* | *-intelmicemul-*)
 	tmake_file="${tmake_file} i386/t-intelmic"
+	tm_file="${tm_file} i386/intelmic-offload.h"
 	;;
 esac
 
diff --git gcc/config/i386/intelmic-offload.h gcc/config/i386/intelmic-offload.h
new file mode 100644
index 0000000..dc346c7
--- /dev/null
+++ gcc/config/i386/intelmic-offload.h
@@ -0,0 +1,35 @@ 
+/* Definitions for Intel MIC offloading.
+
+   Copyright (C) 2014 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef INTELMIC_OFFLOAD_H
+#define INTELMIC_OFFLOAD_H
+
+/* Support for OpenACC acc_on_device.  */
+
+#include "gomp-constants.h"
+
+#define ACCEL_COMPILER_acc_device GOMP_DEVICE_INTEL_MIC
+
+#endif