title: How to handle a python list with PyCUDA?
body: <p>I guess this is a rather easy question for an expert, yet I can't find any answers in the net. Given a simple case:</p>
  
  <p><strong>The problem:</strong></p>
  
  <pre><code>listToProcess = []
  for i in range(0, 10):
      listToProcess.append(i)
  </code></pre>
  
  <p>This list shall be transfered to the GPU, for further processing. I would then go on with a common cuda procedure for mem-copy:</p>
  
  <pre><code>import sys
  import pycuda.autoinit
  import pycuda.driver as cuda
  
  listToProcess_gpu = cuda.mem_alloc(sys.getsizeof(listToProcess))
  cuda.memcpy_htod(listToProcess_gpu, listToProcess)
  </code></pre>
  
  <p>and afterwards call the kernel itself. However lists have no <em>buffer</em> interfaces, so that <code>memcpy_htod()</code> crashes. I tried different approaches too but in the end it leads to </p>
  
  <p><strong>The questions</strong></p>
  
  <ul>
  <li>How does one transfer a list with its content from a python program to the GPU kernel ?</li>
  <li>How does one specify the data type of the list (i.e. a list of floats, or ints, or ...) for the kernel?</li>
  </ul>