title: CUDA streams not running in parallel
body: <p>Given this code:</p>
  
  <pre><code>void foo(cv::gpu::GpuMat const &amp;src, cv::gpu::GpuMat *dst[], cv::Size const dst_size[], size_t numImages)
  {
      cudaStream_t streams[numImages];
      for (size_t image = 0; image &lt; numImages; ++image)
      {
          cudaStreamCreateWithFlags(&amp;streams[image], cudaStreamNonBlocking);
          dim3 Threads(32, 16);
          dim3 Blocks((dst_size[image].width + Threads.x - 1)/Threads.x,
                      (dst_size[image].height + Threads.y - 1)/Threads.y);
          myKernel&lt;&lt;&lt;Blocks, Threads, 0, streams[image]&gt;&gt;&gt;(src, dst[image], dst_size[image]);
      }
      for (size_t image = 0; image &lt; numImages; ++image)
      {
          cudaStreamSynchronize(streams[image]);
          cudaStreamDestroy(streams[image]);
      }
  }
  </code></pre>
  
  <p>Looking at the output of <code>nvvp</code>, I see almost perfectly serial execution, even though the first stream is a lengthy process that the others should be able to overlap with.</p>
  
  <p>Note that my kernel uses 30 registers, and all report an "Achieved Occupancy" of around 0.87. For the smallest image, Grid Size is [10,15,1] and Block Size [32, 16,1].</p>