> -----Original Message-----
> From: Jeff Law [mailto:l...@redhat.com]
> Sent: Tuesday, December 3, 2013 1:30 AM
> To: Jason Merrill; Iyer, Balaji V; Aldy Hernandez
> Cc: gcc-patches@gcc.gnu.org; r...@redhat.com; Jakub Jelinek
> Subject: Re: [PATCH] _Cilk_for for C and C++
> 
> On 11/27/13 17:52, Jason Merrill wrote:
> > On 11/27/2013 04:14 PM, Iyer, Balaji V wrote:
> >>     I completely agree with you that there are certain parts of Cilk
> >> Plus that is similar to OMP4, namely #pragma simd and SIMD-enabled
> >> functions (formerly called elemental functions). But, the Cilk
> >> keywords is almost completely orthogonal to OpenMP. They are
> >> semantically different  and one cannot be transformed to another.
> >> Cilk uses automatically load-balanced work-stealing using the Cilk
> >> runtime, whereas OMP uses work sharing via OMP runtime. There are a
> >> number of other semantic differences but this is the core-issue.
> >> #pragma simd and #pragma omp have converged in several places but the
> >> Cilk part has always been different from OpenMP.
> >
> > Yes, Cilk for loops will use the Cilk runtime and OMP for loops will
> > use the OMP runtime, but that doesn't mean they can't share a lot of
> > the middle end code along the way.
> >
> > We already have several different varieties of parallel/simd loops all
> > represented by GIMPLE_OMP_FOR, and I think this could be another
> > GP_OMP_FOR_KIND_.
> Right.  It's not a question of what runtime they call back into, but that both
> share a common overall structure.
> 
> Conceptually I look at a for loop as having 4 main components.
> 
> Initializer, test condition, increment and the body.
> 
> I'd like to hope things like the syntatic & semantic analysis of the first 
> three
> would be largely the same.  Most of the Cilk specific bits would be in the
> handling of the body -- but there may be some significant code sharing that
> can happen there too.
> 
> 
> >
> > ...
> >> As you can tell, this is not how openmp handles a #pragma omp for loop.
> >
> > It's different in detail, but #pragma omp parallel for works very
> > similarly: it creates a separate function for the body of the loop and
> > then passes that to GOMP_parallel along with any shared data.
> My thoughts exactly.

I understand you both now. Let me look into the OMP routines and see what it is 
doing and see how I can port it to _Cilk_for. 

Thanks,

Balaji V. Iyer.

> jeff

Reply via email to