On 05/24/2011 10:09 PM, Sebastian Pop wrote:
One change that I introduced sometime in February is that some reductions
are not translated to a zero dim array to make the dependence test work
on some of the interchange testcases.  With this change, are we going to
also create privatized copies for the reduction variables that are not
translated into zero dim arrays?


Hi Sebastian,
Could you please provide some more details about these reductions?
An example of loop nest or testcase with such reductions would be very helpful.
In current graphite-opencl implementation only zero dim arrays can be privatized (but local scalar variables are always private).

Currently we are not able to handle reduction between OpenCL kernels,
so loops like this can not be transformed into kernel:

for (i = 0; i < N; i++)
sum += A[i];

We are only able to handle reduction inside kernel's body by privatizing local reduction variable:

for (j = 0; j < M; j++)
{
        int sum = 0;
        for (i = 0; i < N; i++)
                sum+= B[i];

}

In this case we privatize sum[0] (zero dim array created from scalar variable) inside kernel's body (outer loop will be replaced by kernel launch).
--
Alexey Kravets
kayr...@ispras.ru

Reply via email to