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: Jakub Jelinek <jakub at redhat dot com>
- To: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>
- Cc: Jeff Law <law at redhat dot com>, Jason Merrill <jason at redhat dot com>, Aldy Hernandez <aldyh at redhat dot com>, "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>
- Date: Tue, 3 Dec 2013 15:09:24 +0100
- Subject: Re: [PATCH] _Cilk_for for C and C++
- Authentication-results: sourceware.org; auth=none
- References: <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> <529693B0 dot 4050005 at redhat dot com> <529D7A76 dot 1080001 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4AE391 at FMSMSX101 dot amr dot corp dot intel dot com> <20131203134026 dot GY892 at tucnak dot redhat dot com> <BF230D13CA30DD48930C31D4099330003A4AE3CC at FMSMSX101 dot amr dot corp dot intel dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Dec 03, 2013 at 02:01:17PM +0000, Iyer, Balaji V wrote:
> In Cilk_for you don't need to privatize any variables. I need to pass in
> the loop_count, the grain (if the user specifies one), the nested function
> and its context to a Cilk specific function:__cilkrts_cilk_for_64 (or 32).
> The nested function has the body of the _Cilk_for and it has 3 parameter,
> context, start and end, where the start and end are passed in by the
> runtime which will tell what parts of the loop to execute. This thread
> has an example: http://gcc.gnu.org/ml/gcc-patches/2013-11/msg03567.html
So Cilk+ only allows say:
_Cilk_for (int ii = 5; ii < 15; ii++)
{
<body>
}
and not
int ii;
_Cilk_for (ii = 5; ii < 15; ii++)
{
<body>
}
? Other variables can be all shared, that is after all the default
for #pragma omp parallel for, except for the IVs and a couple of other
exceptions (e.g. readonly vars etc.), if somebody wants private vars,
they can be surely declared inside of the <body> somwhere.
Jakub