title: Can I pass the reference of cudaStream to a function where it calls a global method
body: <p>I am creating cudaStream in a host function</p>
  
  <pre><code>void callKernel(cudaStream_t* ptrStream)
  {
      kernelDoesNotMatter&lt;&lt;&lt;1,12,0,*ptrStream&gt;&gt;&gt;();
      //Here i am not calling cudaStreamSynchronize
  }
  void host_func()
  {
      cudaStream_t stream;
      cudaStreamCreate(&amp;stream);
      callKernel(&amp;stream);
  
      cudaError_t err = cudaStreamQuery(stream) //err == cudaSuccess?
  }
  </code></pre>
  
  <p>Over here I am not calling cudaStreamSynchronize() after calling kernel in callKernel method why does cudaStreamQuery return cudaSuccess? Is it because we cannot pass the reference of cudaStream_t to another function? Am I missing something in this?</p>
  
  <p>Thanks.</p>