From: Chung-Lin Tang <chunglin_tang@mentor.com>
To: Thomas Schwinge <thomas@codesourcery.com>,
Chung-Lin Tang <cltang@codesourcery.com>
Cc: <gcc-patches@gcc.gnu.org>, Tom de Vries <tdevries@suse.de>
Subject: Re: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes
Date: Mon, 10 Dec 2018 10:02:00 -0000 [thread overview]
Message-ID: <a5ae7643-9b0b-42d2-75fb-2bc8d4fc40ce@mentor.com> (raw)
In-Reply-To: <yxfppnue8jb6.fsf@hertz.schwinge.homeip.net>
On 2018/12/7 04:57 AM, Thomas Schwinge wrote>> ---
a/libgomp/plugin/plugin-nvptx.c
>> +++ b/libgomp/plugin/plugin-nvptx.c
>
>> +struct goacc_asyncqueue *
>> +GOMP_OFFLOAD_openacc_async_construct (void)
>> +{
>> + struct goacc_asyncqueue *aq
>> + = GOMP_PLUGIN_malloc (sizeof (struct goacc_asyncqueue));
>> + aq->cuda_stream = NULL;
>> + CUDA_CALL_ASSERT (cuStreamCreate, &aq->cuda_stream, CU_STREAM_DEFAULT);
>
> Curiously (this was the same in the code before): does this have to be
> "CU_STREAM_DEFAULT" instead of "CU_STREAM_NON_BLOCKING", because we want
> to block anything from running in parallel with "acc_async_sync" GPU
> kernels, that use the "NULL" stream? (Not asking you to change this now,
> but I wonder if this is overly strict?)
IIUC, this non-blocking only pertains to the "Legacy Default Stream" in
CUDA, which we're pretty much ignoring; we should be using the newer
per-thread default stream model. We could review this issue later.
>> + if (aq->cuda_stream == NULL)
>> + GOMP_PLUGIN_fatal ("CUDA stream create NULL\n");
>
> Can this actually happen, given the "CUDA_CALL_ASSERT" usage above?
Hmm, yeah I think this is superfluous too...
>> + CUDA_CALL_ASSERT (cuStreamSynchronize, aq->cuda_stream);
>
> Why is the synchronization needed here?
I don't remember, could likely be something added during debug.
I'll remove this and test if things are okay.
Thanks,
Chung-Lin
next prev parent reply other threads:[~2018-12-10 10:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-25 13:13 Chung-Lin Tang
2018-10-05 14:07 ` Tom de Vries
2018-12-06 20:57 ` Thomas Schwinge
2018-12-10 10:02 ` Chung-Lin Tang [this message]
2018-12-11 13:50 ` [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes (revised, v2) Chung-Lin Tang
2018-12-18 15:07 ` [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes (revised, v3) Chung-Lin Tang
2023-01-12 13:51 ` nvptx: Avoid deadlock in 'cuStreamAddCallback' callback, error case (was: [PATCH 6/6, OpenACC, libgomp] Async re-work, nvptx changes) Thomas Schwinge
2023-01-13 13:17 ` Chung-Lin Tang
2023-01-13 13:59 ` Thomas Schwinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a5ae7643-9b0b-42d2-75fb-2bc8d4fc40ce@mentor.com \
--to=chunglin_tang@mentor.com \
--cc=cltang@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=tdevries@suse.de \
--cc=thomas@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).