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

On Mon, Nov 09, 2015 at 08:59:15AM -0500, Nathan Sidwell wrote:
> >This I'm afraid performs often two copies rather than just one (one to copy
> >the host value to the present_copyin mapped value, another one in the
> >region),
> 
> I don't think that can be avoided.  The host doesn't have control over when
> the CTAs (a gang) start -- they may even be serialized onto the same
> physical HW. So each gang has to initialize its own instance.  Or did you
> mean something else?

So, what is the scope of the private and firstprivate vars in OpenACC?
In OpenMP if a variable is private or firstprivate on the target construct,
unless further privatized in inner constructs it is really shared among all
the threads in all the teams (ro one var per all CTAs/workers in PTX terms).
Is that the case for OpenACC too, or are the vars e.g. private to each CTA
already or to each thread in each CTA, something different?
If they are shared by all CTAs, then you should hopefully be able to use the
GOMP_MAP_FIRSTPRIVATE{,_INT}, if not, then I'd say you should at least use
those to provide you the initializer data to initialize your private vars
from as a cheaper alternative to mapping.

	Jakub

  parent reply	other threads:[~2015-11-09 14:10 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
2015-11-09 14:10     ` Jakub Jelinek [this message]
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=20151109141034.GS5675@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=cesar_philippidis@mentor.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.org \
    /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).