Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenCL Ndrange Global Size/Local Size
    text
    copied!<p>I am trying to detect a circle in binary image using hough transform. the problem with local and global work size in NDrangekernel i dont know the optimise value needed for that the global_work_size put the value of dimension process image such 512*512 local_work_size when put value 1 or 8 or 16 its ok the program run ok but when change value to 32 or 64 the compile is ok and the program run faster for execute time but no result in output for accumulator in[]</p> <p>the size of image 512*512<br> size_t szGlobalWorkSize[2]={img.cols,img.rows}; size_t szLocalWorkSize[2]={16,16}; </p> <pre><code> clEnqueueNDRangeKernel(clCommandQueue,hough_circle,2,NULL,szGlobalWorkSize,szLoc‌alWorkSize,0,NULL,&amp;event);​ </code></pre> <p>the kernel code is :</p> <pre><code> kernel void hough_circle(read_only image2d_t imageIn, global int* in,const int w_hough) { sampler_t sampler=CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST; int gid0 = get_global_id(0); int gid1 = get_global_id(1); uint4 pixel; pixel=read_imageui(imageIn,sampler,(int2)(gid0,gid1)); if(pixel.x==255) { for(int r=90;r&lt;110;r+=1) { for(int theta=0; theta&lt;360;theta++) { x0=(int) round(gid0-r*sin_parameter[theta] ); y0=(int) round(gid1-r*cos_parameter[theta] ); if((x0&gt;0) &amp;&amp; (x0&lt;get_global_size(0)) &amp;&amp; (y0&gt;0)&amp;&amp;(y0&lt;get_global_size(1))) atom_inc(&amp;in[w_hough*y0+x0]); } } } } </code></pre> <p>any help for select optimum value for global and local size</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload