This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] _Cilk_for for C and C++
- From: Jason Merrill <jason at redhat dot com>
- To: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>, Jeff Law <law at redhat dot com>, Aldy Hernandez <aldyh at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "rth at redhat dot com" <rth at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 27 Nov 2013 19:52:00 -0500
- Subject: Re: [PATCH] _Cilk_for for C and C++
- Authentication-results: sourceware.org; auth=none
- References: <BF230D13CA30DD48930C31D4099330003A49F0C1 at FMSMSX101 dot amr dot corp dot intel dot com> <52869727 dot 4060307 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4A8DA6 at FMSMSX101 dot amr dot corp dot intel dot com> <528F8A42 dot 1040704 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4AC599 at FMSMSX101 dot amr dot corp dot intel dot com> <52962687 dot 2020107 at redhat dot com> <52964B50 dot 6090006 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4AD05D at FMSMSX101 dot amr dot corp dot intel dot com>
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_.
...
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.
Jason