title: gcl_memcpy auto detection of pointer types
body: <p>I have a trivial kernel running on OS X that returns a single int.  The essential bits are:</p>
  
  <pre><code>cl_int d;
  cl_int* dptr = &amp;d;
  
  void* dev_d = gcl_malloc(sizeof(cl_int),NULL,CL_MEM_WRITE_ONLY);
  
  // ... stuff to setup dispatch queue
  
  dispatch_sync(queue, ^{
  
      // ... running the kernel stuff
  
      gcl_memcpy((void*)&amp;d, dev_d, sizeof(cl_int));   // this gives d==0
      gcl_memcpy((void*)dptr, dev_d, sizeof(cl_int)); // this gives correct d
  });
  </code></pre>
  
  <p>Question is, what is the difference between &amp;d and dptr?  I've always thought of them as essentially interchangeable, but gcl_memcpy seems to be making a distinction.  Any ideas?  I can obviously just use the dptr solution, but I'm still curious what's happening.</p>