title: cuda filter with ouput of this block is the input of the next block
body: <p>Working on a filter following, I am having a problem of doing these pieces of codes for processing an image in GPU:</p>
  
  <pre><code>for(int h=0; h&lt;height; h++) {
      for(int w=1; w&lt;width; w++) {
      image[h][w] = (1-a)*image[h][w] + a*image[h][w-1];
      }
  }
  </code></pre>
  
  <p>If I define: </p>
  
  <blockquote>
    <p>dim3 threads_perblock(32, 32)</p>
  </blockquote>
  
  <p>then each block I have: 32 threads can be communicated. The threads of this block can not communicate with the threads from other blocks.</p>
  
  <p>Within a thread_block, I can translate that pieces of code using shared_memory however, for edge (I would say): image[0,31] and image[0,32] in different threadblocks. The image[0,31] should get value from image[0,32] to calculate its value. But they are in different threadblocks.</p>
  
  <p>so that is the problem. </p>
  
  <p>How would I solve this?</p>
  
  <p>Thanks in advance.</p>