title: Pyopencl array sum to add an array
body: <p>I am new to opencl and pyopencl. I am trying to write a basic program to add. I came across <a href="https://documen.tician.de/pyopencl/array.html#pyopencl.array.sum" rel="nofollow noreferrer">this</a> documentation and tried this small code in python. Obviously, it is not working.</p>
  
  <pre><code>import pyopencl as cl
  import pyopencl.tools
  import pyopencl.array
  import numpy
  
  context = cl.create_some_context()
  queue = cl.CommandQueue(context)
  
  h_a = numpy.random.rand(3,3)
  d_a = cl.Buffer(context, cl.mem_flags.READ_ONLY | 
  cl.mem_flags.COPY_HOST_PTR, hostbuf=h_a)
  print cl.array.sum(d_a, dtype=None, queue=queue)
  </code></pre>
  
  <p>As you can assess, I am not sure about how to use those predefined functions.</p>