Hello Aldy and Jakub, Please see my response below. Thanks,
Balaji V. Iyer. > -----Original Message----- > From: Aldy Hernandez [mailto:al...@redhat.com] > Sent: Wednesday, April 24, 2013 7:22 PM > To: Jakub Jelinek > Cc: Iyer, Balaji V; Richard Henderson; gcc-patches@gcc.gnu.org > Subject: Re: [gomp4] Some progress on #pragma omp simd > > [Balaji, see below]. > > Ok, this is confusing. While the document in the link you posted (the ICC > manual?) says so, the document I'm following says otherwise. > > I'm following this (which, until a few days was a link accessible from the > cilk plus > web page, though I no longer see it): Yes, I am aware of the missing link. We are currently looking into it. > > http://software.intel.com/sites/default/files/m/4/e/7/3/1/40297- > Intel_Cilk_plus_lang_spec_2.htm > > The document above is for version 1.1 of the Cilk Plus language extension > specification, which I was told was the latest. There it explicitly says > that the > clauses behave exactly like in OpenMP: > > "The syntax and semantics of the various simd-openmp-data-clauses are > detailed in the OpenMP specification. > (http://www.openmp.org/mp-documents/spec30.pdf, Section 2.9.3)." > > Balaji, can you verify which is correct? For that matter, which are the > official > specs from which we should be basing this work? Privatization clause makes a variable private for the simd lane. In general, I would follow the spec. If you have further questions, please feel free to ask. Thanks, Balaji V. Iyer. > > Aldy > > > On 04/24/13 01:40, Jakub Jelinek wrote: > > On Wed, Apr 24, 2013 at 08:25:36AM +0200, Jakub Jelinek wrote: > >> BTW, the semantics of private/firstprivate/lastprivate desribed in > >> http://software.intel.com/sites/products/documentation/studio/compose > >> r/en- > us/2011Update/compiler_c/cref_cls/common/cppref_pragma_simd.htm > >> doesn't seem to match the semantics of those in #pragma omp simd. > >> private in OpenMP I understand is private to the whole loop (or SIMD > >> lane?; > > > > SIMD lane apparently. Guess that is going to be quite difficult, > > because at the point of omp lowering or expansion we are nowhere close > > to knowing what vectorization factor we are going to choose, all we > > have is an upper bound on that based on the target ISA and safelen clause. > > If say private clause is used with C++ classes with non-trivial > > ctors/dtors that would make a difference. Plus how to represent this in > > the IL. > > > > struct A { A (); ~A (); A (const A &); int i; }; > > > > void > > foo () > > { > > A a, b; > > #pragma omp simd private (a) lastprivate (b) > > for (int i = 0; i < 10; i++) > > { > > a.i++; > > b.i++; > > } > > } > > > > Right now what gomp4 branch does is that it will just construct > > private vars around the whole loop, as in: > > void > > foo () > > { > > A a, b; > > { > > A a', b'; > > int i; > > for (i = 0; i < 10; i++) > > { > > a'.i++; > > b'.i++; > > if (i == 9) > > b = b'; > > } > > } > > } > > > > Jakub > >