title: Bads results with gpu program
body: <p>I haven't got good results with an iterative equation solving.
  I am using a 2D array with "size_y" rows with "size_x" elements for each row.</p>
  
  <p>The problem is that the code only does one iteration because the error cumulative is equal to zero. This cumulative error is computed in the kernel code for each cell of the array.</p>
  
  <p>Here are 2 parts of sources files of this solving :</p>
  
  <p>kernel code :</p>
  
  
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;math.h&gt;
  #include &lt;time.h&gt;
  
  #define min(a,b) a &lt;= b ? a : b
  
  // kernel code
  
  const char *source =
  "__kernel void line_compute(__global double diagx, __global double diagy,\
  __global double weightx, __global double weighty, __global int size_x,\
  __global double* tab_process, __global double* tab_new, __global double* r) {\
    const unsigned int iy = get_global_id(0);\
    const unsigned int ix = get_global_id(1);\
    /* do computation */\
    tab_process[iy*size_x+ix] = weighty *( tab_new[(iy-1)*size_x+ix] +\
    tab_new[(i+1)*size_x+ix] + tab_new[iy*size_x+ix]*diagy)+\
    weightx *( tab_new[iy*size_x+(ix-1)] + tab_new[iy*size_x+(ix+1)] + tab_new[iy*size_x+ix]*diagx) ; \
    r[iy*size_x+ix] = 0;\
    rk = tab_new[iy*size_x+ix] - tab_process[iy*size_x+ix];\
    r[iy*size_x+ix] =r[iy*size_x+ix]+ rk * rk;\
    tab_new[iy*size_x+ix] = tab_process[iy*size_x+ix]\
  }";
  </code></pre>
  
  <p>At the execution, the cumulative error that I print with :</p>
  
  <pre class="lang-c prettyprint-override"><code>result = 0.0;
          for(i=1;i&lt;=size_x*size_y;i++)
               { result = result + r[i];
             printf("r[%d]=%20.18f\n",i,r[i]);
           }
  
          printf("result=%f\n",result);
          *error=result;
  </code></pre>
  
  <p>is equal to zero. That's why the code only does one iteration.</p>
  
  <p>I don't understand where the probem is.
  If anyone could see what's wrong.</p>