pyopencl/pyopencl — pull request #51 by gw0 (2014-06-15 17:25:29+00:00)
Title: Add `out` parameter to ReductionKernel call.

I was missing an option to specify the results location of a ReductionKernel call. Therefore I added it together with offset support for the ``out`` parameter.

Consequently it is now possible to do e.g. per-row reductions of a 2D array:

```python
a_g = cl.array.to_device(queue, a_np)
print a_g

res_g = cl.array.empty(queue, (a_g.shape[0],), a_np.dtype)
for i in range(a_g.shape[0]):
prg(a_g[i], out=res_g[i])
print res_g
```

Outputs:

```
[[ 1. 1. 1. 1. 1.]
[ 0. 4. 0. 0. 0.]
[ 1. 1. 1. 8. 1.]]
[ 5. 4. 12.]
```