[PATCH] _Cilk_for for C and C++
Jason Merrill
jason@redhat.com
Thu Nov 28 08:31:00 GMT 2013
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
More information about the Gcc-patches
mailing list