Inside my kernel, I need an array of accumulators.
__kernel myKernel(...)
{
float accum[SIZE] = {};
for(i=0; i<ITER; ++i) {
accum[...] += ...
}
...
}
In C, the = {}
would initialize the array for me to be filled with 0, but I'm not sure if that's the case in OpenCL? Do I need something like the following, or is it a waste of cycles?
float accum[SIZE];
for(int i=0; i<SIZE; ++i) accum[i] = 0;