This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: OpenACC Firstprivate


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]