This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts
- From: Chung-Lin Tang <chunglin_tang at mentor dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>, Chung-Lin Tang <cltang at codesourcery dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 14 Dec 2018 22:52:44 +0800
- Subject: Re: [PATCH 2/6, OpenACC, libgomp] Async re-work, oacc-* parts
- References: <email@example.com> <firstname.lastname@example.org>
- Reply-to: <cltang at codesourcery dot com>
On 2018/12/14 10:17 PM, Thomas Schwinge wrote:
On Tue, 25 Sep 2018 21:10:47 +0800, Chung-Lin Tang <email@example.com> wrote:
+attribute_hidden struct goacc_asyncqueue *
+lookup_goacc_asyncqueue (struct goacc_thread *thr, bool create, int async)
+ /* The special value acc_async_noval (-1) maps to the thread-specific
+ default async stream. */
+ if (async == acc_async_noval)
+ async = thr->default_async;
+ if (async == acc_async_sync)
+ return NULL;
+ if (async < 0)
+ gomp_fatal ("bad async %d", async);
To make this "resolve" part more obvious, that is, the translation from
the "async" argument to an "asyncqueue" array index:
+ if (!create
+ && (async >= dev->openacc.async.nasyncqueue
+ || !dev->openacc.async.asyncqueue[async]))
+ return NULL;
..., I propose adding a "async2id" function for that, and then rename all
"asyncqueue[async]" to "asyncqueue[id]".
I don't think this is needed. This is the only place in the entire runtime that
does asyncqueue indexing, adding more conceptual layers of re-directed indexing
I do think the more descriptive comments are nice though.
And, this also restores the current trunk behavior, so that
"acc_async_noval" gets its own, separate "asyncqueue".
Is there a reason we need to restore that behavior right now?