bruno villasenor <[email protected]> writes:

> Hi,
>
> I'm trying to run the custom reduction example, the code is:
>
> import pycuda.gpuarray as gpuarray
> import pycuda.driver as cuda
> import pycuda.autoinit
> import numpy
>
> a = gpuarray.arange(400, dtype=numpy.float32)
> b = gpuarray.arange(400, dtype=numpy.float32)
>
> from pycuda.reduction import ReductionKernel
> krnl = ReductionKernel(numpy.float32, neutral="0",
> reduce_expr="a+b", map_expr="x[i]*y[i]",
> arguments="float *x, float *y")
>
> my_dot_prod = krnl(a, b).get()
>
> I get the following error:

Use

krnl = ReductionKernel(numy.dtype(numpy.float32), neutral="0", ...

for now. Current PyCUDA git now also accepts your usage.

Andreas


_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to