Re: libgomp: Guard all offload_images/num_offload_images access by register_lock (was: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks)

2015-09-25 Thread Ilya Verbin
On Fri, Sep 25, 2015 at 18:21:27 +0200, Thomas Schwinge wrote: > On Thu, 26 Mar 2015 23:41:30 +0300, Ilya Verbin wrote: > > On Thu, Mar 26, 2015 at 13:09:19 +0100, Jakub Jelinek wrote: > > > the current code is majorly broken. As I've said earlier, e.g. the lack > > > of mutex guarding gomp_targe

libgomp: Guard all offload_images/num_offload_images access by register_lock (was: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks)

2015-09-25 Thread Thomas Schwinge
Hi! It's still Friday afternoon -- so please bear with me once again... On Thu, 26 Mar 2015 23:41:30 +0300, Ilya Verbin wrote: > On Thu, Mar 26, 2015 at 13:09:19 +0100, Jakub Jelinek wrote: > > the current code is majorly broken. As I've said earlier, e.g. the lack > > of mutex guarding gomp_ta

Re: libgomp: Compile-time error for non-portable gomp_mutex_t initialization (was: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks)

2015-09-25 Thread Jakub Jelinek
On Fri, Sep 25, 2015 at 05:04:47PM +0200, Thomas Schwinge wrote: > Hi! > > It's Friday afternoon -- but anyway, is the following analysis correct? > > On Thu, 26 Mar 2015 23:41:30 +0300, Ilya Verbin wrote: > > On Thu, Mar 26, 2015 at 13:09:19 +0100, Jakub Jelinek wrote: > > > the current code is

libgomp: Compile-time error for non-portable gomp_mutex_t initialization (was: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks)

2015-09-25 Thread Thomas Schwinge
Hi! It's Friday afternoon -- but anyway, is the following analysis correct? On Thu, 26 Mar 2015 23:41:30 +0300, Ilya Verbin wrote: > On Thu, Mar 26, 2015 at 13:09:19 +0100, Jakub Jelinek wrote: > > the current code is majorly broken. As I've said earlier, e.g. the lack > > of mutex guarding gom

Re: acc_on_device for device_type_host_nonshm (was: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks) (PR65742)

2015-05-07 Thread Julian Brown
On Fri, 17 Apr 2015 15:16:19 +0200 Jakub Jelinek wrote: > On Tue, Apr 14, 2015 at 05:43:26PM +0200, Thomas Schwinge wrote: > > On Tue, 14 Apr 2015 15:15:02 +0100, Julian Brown > > wrote: > > > On Wed, 8 Apr 2015 17:58:56 +0300 > > > Ilya Verbin wrote: > > > > I see several regressions: > > > >

Re: acc_on_device for device_type_host_nonshm (was: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks)

2015-04-17 Thread Jakub Jelinek
On Tue, Apr 14, 2015 at 05:43:26PM +0200, Thomas Schwinge wrote: > On Tue, 14 Apr 2015 15:15:02 +0100, Julian Brown > wrote: > > On Wed, 8 Apr 2015 17:58:56 +0300 > > Ilya Verbin wrote: > > > I see several regressions: > > > FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/acc_on_device-1.c > >

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch) (PR65742)

2015-04-17 Thread Julian Brown
On Tue, 14 Apr 2015 15:15:02 +0100 Julian Brown wrote: > On Wed, 8 Apr 2015 17:58:56 +0300 > Ilya Verbin wrote: > > > On Wed, Apr 08, 2015 at 15:31:42 +0100, Julian Brown wrote: > > > This version is mostly the same as the last posted version but > > > has a tweak in GOACC_parallel to account f

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-15 Thread Dominique Dhumieres
> (Not asking for review just yet, JFYI.) This is not a review! but the patch fixes PR65742. Dominique

acc_on_device for device_type_host_nonshm (was: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks)

2015-04-14 Thread Thomas Schwinge
Hi! On Tue, 14 Apr 2015 15:15:02 +0100, Julian Brown wrote: > On Wed, 8 Apr 2015 17:58:56 +0300 > Ilya Verbin wrote: > > I see several regressions: > > FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/acc_on_device-1.c > > -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 execution test > > F

Using -foffload=[...] to cycle through accelerators (was: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks)

2015-04-14 Thread Thomas Schwinge
Hi! On Tue, 14 Apr 2015 15:15:02 +0100, Julian Brown wrote: > The other problem is that it appears that the ACC_DEVICE_TYPE > environment variable is not getting set properly on the target for (any > of) the OpenACC tests: this means a lot of the time the "wrong" plugin > is being tested, and me

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-14 Thread Julian Brown
On Wed, 8 Apr 2015 17:58:56 +0300 Ilya Verbin wrote: > On Wed, Apr 08, 2015 at 15:31:42 +0100, Julian Brown wrote: > > This version is mostly the same as the last posted version but has a > > tweak in GOACC_parallel to account for the new splay tree > > arrangement for target functions: > > > >

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-08 Thread Julian Brown
On Wed, 8 Apr 2015 17:58:56 +0300 Ilya Verbin wrote: > Have you tested it with disabled offloading? > > I see several regressions: > FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/acc_on_device-1.c > -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 execution test > FAIL: libgomp.oacc-c/../l

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-08 Thread Ilya Verbin
On Wed, Apr 08, 2015 at 15:31:42 +0100, Julian Brown wrote: > This version is mostly the same as the last posted version but has a > tweak in GOACC_parallel to account for the new splay tree arrangement > for target functions: > > - tgt_fn = (void (*)) tgt_fn_key->tgt->tgt_start; > + tgt

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-08 Thread Jakub Jelinek
On Wed, Apr 08, 2015 at 03:31:42PM +0100, Julian Brown wrote: > It passes libgomp testing on NVPTX. OK? Please write a proper ChangeLog entry for it. Ok with that. Jakub

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-08 Thread Julian Brown
On Tue, 7 Apr 2015 17:26:45 +0200 Jakub Jelinek wrote: > On Mon, Apr 06, 2015 at 03:45:57PM +0300, Ilya Verbin wrote: > > On Wed, Apr 01, 2015 at 15:20:25 +0200, Jakub Jelinek wrote: > > > LGTM with proper ChangeLog entry. > > > > I've commited this patch into trunk. > > > > Julian, you probabl

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-07 Thread Jakub Jelinek
On Mon, Apr 06, 2015 at 03:45:57PM +0300, Ilya Verbin wrote: > On Wed, Apr 01, 2015 at 15:20:25 +0200, Jakub Jelinek wrote: > > LGTM with proper ChangeLog entry. > > I've commited this patch into trunk. > > Julian, you probably want to update the nvptx plugin. Note that as the number of P1s with

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-06 Thread Ilya Verbin
On Wed, Apr 01, 2015 at 15:20:25 +0200, Jakub Jelinek wrote: > LGTM with proper ChangeLog entry. I've commited this patch into trunk. Julian, you probably want to update the nvptx plugin. gcc/ * config/i386/intelmic-mkoffload.c (generate_host_descr_file): Call GOMP_offload_unreg

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-01 Thread Ilya Verbin
On Wed, Apr 01, 2015 at 15:20:25 +0200, Jakub Jelinek wrote: > On Wed, Apr 01, 2015 at 04:14:05PM +0300, Ilya Verbin wrote: > > I was worried about the following scenario: > > 1. Thread 1 in GOMP_target locks device 1. > > 2. Thread 2 in GOMP_target locks device 2 and calls gomp_fatal. > > 3. GOMP_

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-01 Thread Jakub Jelinek
On Wed, Apr 01, 2015 at 04:14:05PM +0300, Ilya Verbin wrote: > On Wed, Apr 01, 2015 at 07:21:47 +0200, Jakub Jelinek wrote: > > On Wed, Apr 01, 2015 at 02:53:28AM +0300, Ilya Verbin wrote: > > > +/* Similar to gomp_fatal, but release mutexes before. */ > > > + > > > +static void > > > +gomp_fatal_

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-04-01 Thread Ilya Verbin
On Wed, Apr 01, 2015 at 07:21:47 +0200, Jakub Jelinek wrote: > On Wed, Apr 01, 2015 at 02:53:28AM +0300, Ilya Verbin wrote: > > +/* Similar to gomp_fatal, but release mutexes before. */ > > + > > +static void > > +gomp_fatal_unlock (const char *fmt, ...) > > +{ > > + int i; > > + va_list list; >

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-31 Thread Jakub Jelinek
On Wed, Apr 01, 2015 at 02:53:28AM +0300, Ilya Verbin wrote: > +/* Similar to gomp_fatal, but release mutexes before. */ > + > +static void > +gomp_fatal_unlock (const char *fmt, ...) > +{ > + int i; > + va_list list; > + > + for (i = 0; i < num_devices; i++) > +gomp_mutex_unlock (&devices[

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-31 Thread Ilya Verbin
On Tue, Mar 31, 2015 at 19:10:36 +0300, Ilya Verbin wrote: > Ok, thanks for the clarification! Here is the new patch with variables. > > Unfortunately I see 4 fails in make check-target-libgomp with PTX patch > applied > on top, but with disabled offloading to PTX. > Julian, have you seen them?

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-31 Thread Jakub Jelinek
On Tue, Mar 31, 2015 at 09:25:26PM +0300, Ilya Verbin wrote: > On Mon, Mar 30, 2015 at 18:42:02 +0200, Jakub Jelinek wrote: > > Shouldn't either this function, or gomp_offload_image_to_device lock > > also devicep->lock mutex and unlock at the end? > > Where exactly I guess depends on if the device

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-31 Thread Ilya Verbin
On Mon, Mar 30, 2015 at 18:42:02 +0200, Jakub Jelinek wrote: > Shouldn't either this function, or gomp_offload_image_to_device lock > also devicep->lock mutex and unlock at the end? > Where exactly I guess depends on if the devicep->* hook calls should be > guarded with the mutex or not. If yes, i

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-31 Thread Ilya Verbin
On Tue, Mar 31, 2015 at 15:07:58 +0200, Jakub Jelinek wrote: > On Tue, Mar 31, 2015 at 03:52:06PM +0300, Ilya Verbin wrote: > > > What is the reason to register and allocate these one at a time, rather > > > than > > > using one struct target_mem_desc with one tgt->array for all splay tree > > > n

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-31 Thread Jakub Jelinek
On Tue, Mar 31, 2015 at 03:52:06PM +0300, Ilya Verbin wrote: > > What is the reason to register and allocate these one at a time, rather than > > using one struct target_mem_desc with one tgt->array for all splay tree > > nodes registered from one image? > > Perhaps you would just use tgt_start of

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-31 Thread Ilya Verbin
On Mon, Mar 30, 2015 at 22:42:51 +0100, Julian Brown wrote: > On Mon, 30 Mar 2015 18:42:02 +0200 > Jakub Jelinek wrote: > > But the one Julian posted doesn't apply on top of your patch. > > If there is any interdiff needed on top of your patch, can it be > > posted against trunk + your patch? > >

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-30 Thread Julian Brown
On Mon, 30 Mar 2015 18:42:02 +0200 Jakub Jelinek wrote: > On Thu, Mar 26, 2015 at 11:41:30PM +0300, Ilya Verbin wrote: > > Here is the latest patch for libgomp and mic plugin. > > make check-target-libgomp using intelmic emul passed. > > Also I used a testcase from the attachment. > > This appli

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-30 Thread Jakub Jelinek
On Thu, Mar 26, 2015 at 11:41:30PM +0300, Ilya Verbin wrote: > Here is the latest patch for libgomp and mic plugin. > make check-target-libgomp using intelmic emul passed. > Also I used a testcase from the attachment. This applies cleanly. > Latest ptx part is here, I guess: > https://gcc.gnu.org

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-27 Thread Julian Brown
On Thu, 26 Mar 2015 13:09:19 +0100 Jakub Jelinek wrote: > On Mon, Mar 23, 2015 at 10:44:39PM +0300, Ilya Verbin wrote: > > If it is too late for such global changes (rework initialization in > > libgomp, change mic and ptx plugins), then here is a small > > workaround patch to fix offloading from

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-26 Thread Ilya Verbin
On Thu, Mar 26, 2015 at 13:09:19 +0100, Jakub Jelinek wrote: > On Mon, Mar 23, 2015 at 10:44:39PM +0300, Ilya Verbin wrote: > > If it is too late for such global changes (rework initialization in libgomp, > > change mic and ptx plugins), then here is a small workaround patch to fix > > offloading f

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-26 Thread Jakub Jelinek
On Mon, Mar 23, 2015 at 10:44:39PM +0300, Ilya Verbin wrote: > If it is too late for such global changes (rework initialization in libgomp, > change mic and ptx plugins), then here is a small workaround patch to fix > offloading from libraries. Likely, it will not affect OpenACC programs with > o

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks

2015-03-26 Thread Thomas Schwinge
Hi! On Mon, 23 Mar 2015 22:44:39 +0300, Ilya Verbin wrote: > On Mon, Mar 09, 2015 at 14:45:55 +, Julian Brown wrote: > > On Fri, 6 Mar 2015 17:01:13 +0300 > > Ilya Verbin wrote: > > > > > On Thu, Feb 26, 2015 at 20:25:11 +0300, Ilya Verbin wrote: > > > > On Wed, Feb 25, 2015 at 10:36:08 +01

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-23 Thread Ilya Verbin
On Mon, Mar 09, 2015 at 14:45:55 +, Julian Brown wrote: > On Fri, 6 Mar 2015 17:01:13 +0300 > Ilya Verbin wrote: > > > On Thu, Feb 26, 2015 at 20:25:11 +0300, Ilya Verbin wrote: > > > On Wed, Feb 25, 2015 at 10:36:08 +0100, Thomas Schwinge wrote: > > > > > Julian Brown wrote: > > > > > This

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-09 Thread Julian Brown
On Fri, 6 Mar 2015 17:01:13 +0300 Ilya Verbin wrote: > On Thu, Feb 26, 2015 at 20:25:11 +0300, Ilya Verbin wrote: > > On Wed, Feb 25, 2015 at 10:36:08 +0100, Thomas Schwinge wrote: > > > > Julian Brown wrote: > > > > This is a version of the previously-posted patch to rework > > > > initialisati

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-03-06 Thread Ilya Verbin
On Thu, Feb 26, 2015 at 20:25:11 +0300, Ilya Verbin wrote: > On Wed, Feb 25, 2015 at 10:36:08 +0100, Thomas Schwinge wrote: > > > Julian Brown wrote: > > > This is a version of the previously-posted patch to rework > > > initialisation and support the proposed load/unload hooks, merged to > > > go

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-02-26 Thread Ilya Verbin
Hi, On Wed, Feb 25, 2015 at 10:36:08 +0100, Thomas Schwinge wrote: > > Julian Brown wrote: > > This is a version of the previously-posted patch to rework > > initialisation and support the proposed load/unload hooks, merged to > > gomp4 branch and tested alongside the two patches (from Currently

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-02-25 Thread Ilya Verbin
On Wed, Feb 25, 2015 at 10:36:08 +0100, Thomas Schwinge wrote: > > Julian Brown wrote: > > OK for gomp4 branch? I could commit Ilya's patch there too if so. > > I'll leave the decision to Jakub, but, what about trunk? As Ilya > indicated in >

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-02-25 Thread Julian Brown
On Wed, 25 Feb 2015 10:36:08 +0100 Thomas Schwinge wrote: > Hi! > > On Tue, 24 Feb 2015 11:29:51 +, Julian Brown > wrote: > > Test results look OK, barring a suspected harness issue (lib-83 > > failing with a timeout for nvptx > > However, I'm seeing a class of testsuite regressions: all v

libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch)

2015-02-25 Thread Thomas Schwinge
Hi! On Tue, 24 Feb 2015 11:29:51 +, Julian Brown wrote: > On Wed, 4 Feb 2015 15:05:45 + > Julian Brown wrote: > > > The major changes are: [...] Thanks for looking into this! > This is a version of the previously-posted patch to rework > initialisation and support the proposed load/u