On Tue, Jan 07, 2014 at 10:11:59PM +0000, Iyer, Balaji V wrote: > I used a similar existing one (safelen). Attached, please find 2 > fixed patches for C and C++ along with their changelogs.
But safelen is something completely different, while if I skim the _Cilk_for docs, the grain is really a chunk size, where the runtime library performs the scheduling of grain sized chunks, so using OMP_CLAUSE_SCHEDULE clause with OMP_CLAUSE_SCHEDULE_KIND (c) = OMP_CLAUSE_SCHEDULE_RUNTIME; OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (c) = grain_expr; sounds like what should be used. OMP_CLAUSE_SAFELEN says what is the minimal vectorization factor the compiler can assume is safe for a simd loop. Jakub