title: CUDA device pointers
body: <p>Quick question about the standard CUDA memory allocation model: </p>
  
  <pre><code>double* x_device;
  cudaMalloc(&amp;x_device,myArraySize);
  </code></pre>
  
  <p>The variable <code>x_device</code> is a pointer-to-double.  After I call cudaMalloc, does x_device now point to a memory location <em>on the cuda device</em>?  So, in other words, <code>*x_device</code> would result in a segfault because we can't directly access device memory from the host.</p>
  
  <p>Incidental question, the compiler doesn't complain that I don't use <code>(void**)&amp;x_device</code>, is this required?  I sometimes see it in examples, sometimes not.</p>
  
  <p>Thanks!</p>