title: Copy an object to device?
body: <p>Can I copy a C++ object to the device?</p>
  
  <p>say I have:</p>
  
  <pre><code>class CudaClass
  {
  public:
  int* data;
  CudaClass(int x) {
      data = new int[1]; data[0] = x;
  }
  };
  
  __global__ void useClass(CudaClass cudaClass)
  {
      printf("%d" cudaClass.data[0]);
  };
  
  
  int main()
  {
      CudaClass c(1);
  }
  </code></pre>
  
  <p>Now how do I copy "c" to device memory and launch kernel "useClass"?</p>