Simple question

Discussion created by erman_amd on Mar 10, 2011
Latest reply on Mar 10, 2011 by himanshu.gautam
Add all elements in an array


I have a sequential function code below. I want to make it parallel as OpenCL kernel, but I think this can not be parallelize. Am I right? CMIIW. Thanks for help.





... float sum = 0; for(i=0; i<h;i++) for(j=0; j<w;j++) sum+= array[i*w+j]; return sum;