Re: OpenACC Firstprivate

2015-11-12 Thread Thomas Schwinge
Hi Nathan! Merging back your trunk r230169 into gomp-4_0-branch, for the new libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-2.c test, I'm seeing the compiler diagnose as follows (compile with "-Wall -O2"): source-gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-2.c: In

Re: OpenACC Firstprivate

2015-11-11 Thread Nathan Sidwell
On 11/11/15 03:04, Jakub Jelinek wrote: On Tue, Nov 10, 2015 at 09:12:55AM -0500, Nathan Sidwell wrote: + /* Create a local object to hold the instance + value. */ + tree inst = create_tmp_var + (TREE_TYPE (TREE_TYPE (

Re: OpenACC Firstprivate

2015-11-11 Thread Jakub Jelinek
On Tue, Nov 10, 2015 at 09:12:55AM -0500, Nathan Sidwell wrote: > + /* Create a local object to hold the instance > +value. */ > + tree inst = create_tmp_var > + (TREE_TYPE (TREE_TYPE (new_var)), > +IDENTIFIE

Re: OpenACC Firstprivate

2015-11-10 Thread Nathan Sidwell
On 11/09/15 09:46, Nathan Sidwell wrote: I'm going to try and get clarification, but I think the intent is to initialize with the value seen on the device. Consider: My thinking is that the intent of the firstprivate is to initialize with the value known on the device (and behave as-if copyi

Re: OpenACC Firstprivate

2015-11-09 Thread Nathan Sidwell
On 11/09/15 09:10, Jakub Jelinek wrote: 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.

Re: OpenACC Firstprivate

2015-11-09 Thread Jakub Jelinek
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

Re: OpenACC Firstprivate

2015-11-09 Thread Nathan Sidwell
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)

Re: OpenACC Firstprivate

2015-11-09 Thread Nathan Sidwell
On 11/09/15 08:46, Jakub Jelinek wrote: On Sat, Nov 07, 2015 at 08:50:28AM -0500, Nathan Sidwell wrote: Index: gcc/gimplify.c === If you want to switch to hexadecimal, you should change all values in the enum to hexadecimal for

Re: OpenACC Firstprivate

2015-11-09 Thread Jakub Jelinek
On Sat, Nov 07, 2015 at 08:50:28AM -0500, Nathan Sidwell wrote: > Index: gcc/gimplify.c > === > --- gcc/gimplify.c(revision 229892) > +++ gcc/gimplify.c(working copy) > @@ -108,9 +108,15 @@ enum omp_region_type >/* Data reg