This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: OpenACC Firstprivate
- From: Nathan Sidwell <nathan at acm dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Cesar Philippidis <cesar_philippidis at mentor dot com>
- Date: Mon, 9 Nov 2015 09:06:05 -0500
- Subject: Re: OpenACC Firstprivate
- Authentication-results: sourceware.org; auth=none
- References: <563E01A4 dot 20607 at acm dot org> <20151109134619 dot GQ5675 at tucnak dot redhat dot com> <5640A6B3 dot 3030409 at acm dot 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