cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

erman_amd
Journeyman III

Simple question

Add all elements in an array

Hi,

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;

Tags (1)
0 Likes
Reply
1 Reply
himanshu_gautam
Grandmaster

Simple question

erman_amd,

The code is parallelizeable quite easily.Refer to the Reduction samples from the SDK. 

0 Likes
Reply