This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] _Cilk_for for C and C++


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]