Note that there are some explanatory texts on larger screens.

plurals
  1. POopencl local array within kernel
    primarykey
    data
    text
    <p>I am trying to detect a circle in binary image using hough transform. and post my problem here <a href="https://stackoverflow.com/questions/19667582/hough-transform-improving-algorithm-efficiency-over-opencl">Hough Transform: improving algorithm efficiency over OpenCL</a></p> <p>the kernel code is very slow when execute . the wait time in atomic function and i try to use local memory for that is faster but the problem in output accumulator in[] the kernel code </p> <pre><code> kernel void hough_circle(read_only image2d_t imageIn, global int* in,const int w_hough,__global int * circle) { 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); const int nWidth = get_local_size(0); int i = get_group_id(0); int j = get_group_id(1); int idX = get_local_id(0); int idY = get_local_id(1); int ii = i*nWidth + idX; int jj = j*nWidth + idY; uint4 pixel; int x0=0,y0=0,r; int maxval=0; local int localImage[25]; localImage[idY*5+idX] = 0; barrier(CLK_LOCAL_MEM_FENCE); pixel=read_imageui(imageIn,sampler,(int2)(gid0,gid1)); if(pixel.x==255) { // #pragma unroll 20 for(int r=90;r&lt;110;r+=1) { // int r=190; // #pragma unroll 360 for(int theta=0; theta&lt;360;theta++) { // x0=(int) round(gid0-r*cos( (float) radians( (float) theta) )); // y0=(int) round(gid1-r*sin( (float) radians( (float) 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))) // in[w_hough*y0+x0]++; localImage[5*y0+x0]++; // atom_inc(&amp;in[w_hough*y0+x0]); } } } in[jj*w_hough+ii]= localImage[jj*5+ii]; } </code></pre> <p>the local the problem in output accumulator in[] show incorrect value random can any one help me what change i do to solve the problem </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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