public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@acm.org>
To: Jakub Jelinek <jakub@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Cesar Philippidis <cesar_philippidis@mentor.com>
Subject: Re: OpenACC Firstprivate
Date: Mon, 09 Nov 2015 14:06:00 -0000	[thread overview]
Message-ID: <5640A84D.30902@acm.org> (raw)
In-Reply-To: <5640A6B3.3030409@acm.org>

On 11/09/15 08:59, Nathan Sidwell wrote:
> On 11/09/15 08:46, Jakub Jelinek wrote:
>> On Sat, Nov 07, 2015 at 08:50:28AM -0500, Nathan Sidwell wrote:

>
>> Say
>>    int arr[64];
>> // initialize arr
>> #pragma acc data copyin (arr)
>> {
>>    // modify arr on the host
>>    # pragma acc parallel firstprivate (arr)
>>    {
>>      ...
>>    }
>> }
>
> Hm, I suspect that is either ill formed or the std does not contemplate.

just realized, there are two ways to consider the above.

1) it's  ill formed.   Once you've transferred data to the device, modifying it 
on the host is unspecified.  I'm having trouble finding words in the std that 
actually say that though :(

2) on a system with shared physical global memory, the host modification would 
be visiable on the device (possibly at an arbitrary point due to lack of 
synchronization primitive?)

I don't think this changes 'why not use OpenMP's ...' question, because IIUC you 
think that can be made to DTRT anyway?

nathan

  reply	other threads:[~2015-11-09 14:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07 13:50 Nathan Sidwell
2015-11-09 13:46 ` Jakub Jelinek
2015-11-09 13:59   ` Nathan Sidwell
2015-11-09 14:06     ` Nathan Sidwell [this message]
2015-11-09 14:10     ` Jakub Jelinek
2015-11-09 14:46       ` Nathan Sidwell
2015-11-10 14:13         ` Nathan Sidwell
2015-11-11  8:05           ` Jakub Jelinek
2015-11-11 13:44             ` Nathan Sidwell
2015-11-12  9:00               ` Thomas Schwinge
2015-11-11 13:52             ` [gomp4] Rework gimplifyier region flags Nathan Sidwell

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=5640A84D.30902@acm.org \
    --to=nathan@acm.org \
    --cc=cesar_philippidis@mentor.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).