Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts (revised, v4)

2019-01-08 Thread Chung-Lin Tang
On 2019/1/7 10:15 AM, Thomas Schwinge wrote: Well, the "Properly handle wait clause with no arguments" changes still need to be completed and go in first (to avoid introducing regressions), and then I will have to see your whole set of changes that you intend to commit: the bits you've

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts (revised, v4)

2019-01-07 Thread Thomas Schwinge
Hi Chung-Lin! On Sat, 5 Jan 2019 17:47:10 +0800, Chung-Lin Tang wrote: > this is the current version of the oacc-* parts of the Async Re-work patch. > > I have reverted away from the earlier mentioned attempt of using lockless > techniques to manage the asyncqueues; it is really hard to do in

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts (revised, v2)

2019-01-07 Thread Thomas Schwinge
Hi Chung-Lin! On Wed, 2 Jan 2019 20:46:12 +0800, Chung-Lin Tang wrote: > Hi Thomas, Happy New Year, Thanks! If I remember right, you still have a few weeks until "your" New Year/Spring Festival, right? > On 2018/12/19 5:03 AM, Thomas Schwinge wrote: > >> + > >> + if

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts (revised, v4)

2019-01-05 Thread Chung-Lin Tang
Hi Thomas, this is the current version of the oacc-* parts of the Async Re-work patch. I have reverted away from the earlier mentioned attempt of using lockless techniques to manage the asyncqueues; it is really hard to do in a 100% correct manner, unless we only use something like simple lists

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts (revised, v2)

2019-01-02 Thread Chung-Lin Tang
Hi Thomas, Happy New Year, On 2018/12/19 5:03 AM, Thomas Schwinge wrote: + + if (!dev->openacc.async.asyncqueue[async]) +{ + dev->openacc.async.asyncqueue[async] = dev->openacc.async.construct_func (); + + if (!dev->openacc.async.asyncqueue[async]) + { +

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts (revised, v3)

2018-12-28 Thread Thomas Schwinge
Hi Chung-Lin! On Sat, 22 Dec 2018 00:04:56 +0800, Chung-Lin Tang wrote: > On 2018/12/19 5:03 AM, Thomas Schwinge wrote: > > On Tue, 18 Dec 2018 23:06:38 +0800, Chung-Lin Tang > > wrote: > >> this part includes some of the lookup_goacc_asyncqueue fixes we talked > >> about. > >> I am still

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts (revised, v3)

2018-12-21 Thread Chung-Lin Tang
On 2018/12/19 5:03 AM, Thomas Schwinge wrote: Hi Chung-Lin! On Tue, 18 Dec 2018 23:06:38 +0800, Chung-Lin Tang wrote: this part includes some of the lookup_goacc_asyncqueue fixes we talked about. I am still thinking about how the queue lock problem should really be solved, so regard this

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts (revised, v2)

2018-12-18 Thread Thomas Schwinge
Hi Chung-Lin! On Tue, 18 Dec 2018 23:06:38 +0800, Chung-Lin Tang wrote: > this part includes some of the lookup_goacc_asyncqueue fixes we talked about. > I am still thinking about how the queue lock problem should really be solved, > so regard > this patch as just fixing some of the problems.

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts (revised, v2)

2018-12-18 Thread Chung-Lin Tang
On 2018/9/25 9:10 PM, Chung-Lin Tang wrote: Hi Thomas, These are the OpenACC specific changes, mostly the re-implementation of async-related acc_* runtime library API functions to use the new backend plugin interfaces, in a non-target specific way. Hi Thomas, this part includes some of the

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-18 Thread Thomas Schwinge
Hi Chung-Lin! On Tue, 18 Dec 2018 18:02:54 +0800, Chung-Lin Tang wrote: > On 2018/12/17 10:32 PM, Thomas Schwinge wrote: > >> The reason there are deadlocks from inside the plugin on > >> GOMP_PLUGIN_fatal() is when we hold the > >> struct gomp_device_descr's*device* lock, which is also

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-18 Thread Chung-Lin Tang
On 2018/12/17 10:32 PM, Thomas Schwinge wrote: The reason there are deadlocks from inside the plugin on GOMP_PLUGIN_fatal() is when we hold the struct gomp_device_descr's*device* lock, which is also acquired when we execute atexit device shutdown handlers, hence the deadlock. I don't think

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-18 Thread Chung-Lin Tang
On 2018/12/17 9:52 PM, Thomas Schwinge wrote: Hi Chung-Lin! On Fri, 14 Dec 2018 22:52:44 +0800, Chung-Lin Tang wrote: On 2018/12/14 10:17 PM, Thomas Schwinge wrote: On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang wrote: --- a/libgomp/oacc-async.c +++ b/libgomp/oacc-async.c

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-17 Thread Thomas Schwinge
Hi Chung-Lin! On Mon, 17 Dec 2018 19:03:12 +0800, Chung-Lin Tang wrote: > On 2018/12/14 10:56 PM, Thomas Schwinge wrote: > > + //TODO Are these safe to call, or might this cause deadlock if > > something's locked? > > CUDA_CALL_ASSERT (cuEventCreate, , CU_EVENT_DISABLE_TIMING); > >

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-17 Thread Thomas Schwinge
Hi Chung-Lin! On Fri, 14 Dec 2018 23:00:57 +0800, Chung-Lin Tang wrote: > On 2018/12/14 10:53 PM, Thomas Schwinge wrote: > > Please comment on the one TODO > > which before your async re-work also was -- incorrectly? -- run > > asynchronously? > > @@ -563,6 +563,8 @@ GOACC_update (int device,

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-17 Thread Thomas Schwinge
Hi Chung-Lin! On Fri, 14 Dec 2018 22:42:28 +0800, Chung-Lin Tang wrote: > On 2018/12/14 10:32 PM, Thomas Schwinge wrote: > > Invoked as "acc_wait_async ([...], acc_async_sync)" (as used in a test > > case that I'll soon submit/commit), we'll end up with "aq2 == NULL", and > > will segfault in

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-17 Thread Thomas Schwinge
Hi Chung-Lin! On Fri, 14 Dec 2018 22:52:44 +0800, Chung-Lin Tang wrote: > On 2018/12/14 10:17 PM, Thomas Schwinge wrote: > > On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang > > wrote: > >> --- a/libgomp/oacc-async.c > >> +++ b/libgomp/oacc-async.c > > > >> +attribute_hidden struct

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-17 Thread Chung-Lin Tang
On 2018/12/14 10:56 PM, Thomas Schwinge wrote: Hi Chung-Lin! On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang wrote: --- a/libgomp/oacc-async.c +++ b/libgomp/oacc-async.c +attribute_hidden struct goacc_asyncqueue * +lookup_goacc_asyncqueue (struct goacc_thread *thr, bool create, int async)

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-14 Thread Chung-Lin Tang
On 2018/12/14 10:53 PM, Thomas Schwinge wrote: Additionally the following, or why not? Please comment on the one TODO which before your async re-work also was -- incorrectly? -- run asynchronously? diff --git libgomp/oacc-parallel.c libgomp/oacc-parallel.c index 5a441c9efe38..91875c57fc97

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-14 Thread Thomas Schwinge
Hi Chung-Lin! On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang wrote: > --- a/libgomp/oacc-async.c > +++ b/libgomp/oacc-async.c > +attribute_hidden struct goacc_asyncqueue * > +lookup_goacc_asyncqueue (struct goacc_thread *thr, bool create, int async) > +{ > + /* The special value

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-14 Thread Thomas Schwinge
Hi Chung-Lin! On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang wrote: > --- a/libgomp/oacc-parallel.c > +++ b/libgomp/oacc-parallel.c > @@ -377,8 +360,6 @@ GOACC_enter_exit_data (int device, size_t mapnum, > finalize = true; > } > > - acc_dev->openacc.async_set_async_func

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-14 Thread Chung-Lin Tang
On 2018/12/14 10:17 PM, Thomas Schwinge wrote: Hi Chung-Lin! On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang wrote: --- a/libgomp/oacc-async.c +++ b/libgomp/oacc-async.c +attribute_hidden struct goacc_asyncqueue * +lookup_goacc_asyncqueue (struct goacc_thread *thr, bool create, int

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-14 Thread Chung-Lin Tang
On 2018/12/14 10:32 PM, Thomas Schwinge wrote: Invoked as "acc_wait_async ([...], acc_async_sync)" (as used in a test case that I'll soon submit/commit), we'll end up with "aq2 == NULL", and will segfault in the nvptx "openacc.async.serialize_func". What does "wait async(acc_async_sync)"

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-14 Thread Thomas Schwinge
Hi Chung-Lin! On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang wrote: > void > acc_wait_async (int async1, int async2) > { > + struct goacc_thread *thr = get_goacc_thread (); > > + goacc_aq aq2 = lookup_goacc_asyncqueue (thr, true, async2); > + goacc_aq aq1 = lookup_goacc_asyncqueue

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-14 Thread Thomas Schwinge
Hi Chung-Lin! On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang wrote: > --- a/libgomp/oacc-async.c > +++ b/libgomp/oacc-async.c > +attribute_hidden struct goacc_asyncqueue * > +lookup_goacc_asyncqueue (struct goacc_thread *thr, bool create, int async) > +{ > + /* The special value

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-14 Thread Thomas Schwinge
Hi Chung-Lin! On Fri, 7 Dec 2018 22:19:14 +0800, Chung-Lin Tang wrote: > On 2018/12/7 07:32 PM, Thomas Schwinge wrote: > > Does the following make sense? > > I don't quite remember why I simply ensured asyncqueue creation here at the > time, > maybe simply because it allowed simpler code at

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-07 Thread Chung-Lin Tang
On 2018/12/7 07:32 PM, Thomas Schwinge wrote: > Hi Chung-Lin! > > On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang > wrote: >> These are the OpenACC specific changes, mostly the re-implementation of >> async-related acc_* runtime >> library API functions to use the new backend plugin

Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-12-07 Thread Thomas Schwinge
Hi Chung-Lin! On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang wrote: > These are the OpenACC specific changes, mostly the re-implementation of > async-related acc_* runtime > library API functions to use the new backend plugin interfaces, in a > non-target specific way. (The patch was

[PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts

2018-09-25 Thread Chung-Lin Tang
Hi Thomas, These are the OpenACC specific changes, mostly the re-implementation of async-related acc_* runtime library API functions to use the new backend plugin interfaces, in a non-target specific way. Thanks, Chung-Lin * oacc-async.c (get_goacc_thread): New function.