title: Why is my array not getting set?
body: <p>I am trying to teach myself CUDA. This has not been easy so far, but I don't give up easily either :)</p>
  
  <p>I have created a very simple program. It merely returns a value from the GPU.</p>
  
  <pre><code>import pycuda.driver as cuda
  from pycuda.compiler import SourceModule
  import pycuda.autoinit
  import numpy as np
  
  returnValue = np.zeros(1)
  mod = SourceModule("""
    __global__ void myVeryFirstKernel(float* returnValue) {
      returnValue[0] = 8.0;
    }
  """)
  func = mod.get_function('myVeryFirstKernel')
  func(cuda.InOut(returnValue), block=(1024, 1, 1), grid=(1, 1))
  print str(returnValue[0])
  </code></pre>
  
  <p>However, the value that my program prints is <code>5.387879938e-315</code>. That sure doesn't look like <code>8.0</code>. Why is the wrong value getting returned from the GPU?</p>
  
  <p>I have tried altering the block size, which I don't think should anything (but who knows). I have also checked that the data type I am sending in (float64) matches my kernel.</p>