title: Using CUDA printf outside the kernel to print device variables
body: <p>What is the best way to print device variables in CUDA outside of the kernel?  Do I have to do a <code>cudaMemcpy</code> to the host and then print the resulting values?  When I try to use <code>printf</code> on pointers created using <code>cudaMalloc</code>, the program crashes.  It seems that most of the attention focuses on printing inside the kernel, not in regular code.</p>
  
  <p>Thanks, Eric</p>