On 04/24/13 18:22, Aldy Hernandez wrote:

Hmmm, furthermore, even if the simd + private semantics in Cilk Plus have the same semantics of the OpenMP standard, is it the OpenMP 3.0 semantics like the openmp link suggests (private to task), or is it the OpenMP 4.0 rc 2 semantics which you suggest (private to SIMD lane)?

Lemme ask icc.

[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):

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?

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/composer/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



Reply via email to