title: cudaThreadSynchronize() requirement
body: <p>I have a cuda program like this :</p>
  
  <pre><code>for (int i=0;i&lt;100000;i++) {
    if (i%2 == 0) {
      bind_x(x) // bind x to texture
      kernel_code&lt;&lt;A,B&gt;&gt;(M,x,y) // calculate y = M*x
    }
    else {
      bind_x(y)
      kernel_code&lt;&lt;A,B&gt;&gt;(M,y,x) // calculate x = M*y
    }
  
    cudaThreadSynchronize();
  
    if (i%2 == 0)
      unbind_x(x)
    else 
      unbind_x(y) // unbind x from texture
  }
  </code></pre>
  
  <p>I heard that if I do not put <code>cudaThreadSynchronize();</code> cpu will continue to run without waiting for the kernel to end so ... Should I call <code>cudaThreadSynchronize()</code> before unbind_x(). I try to run with&amp; without, the result is the same ?!? (And in theory It shouldn't)</p>