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:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/bruno/Desktop/Dropbox/Developer/pyCUDA/reduction.py in <module>()
12 arguments="float *x, float *y")
13
---> 14 my_dot_prod = krnl(a, b).get()
15
16
/usr/local/lib/python2.7/dist-packages/pycuda-2012.1-py2.7-linux-x86_64.egg/pycuda/reduction.pyc
in __call__(self, *args, **kwargs)
272 result = empty((block_count,), self.dtype_out,
repr_vec.allocator)
273
--> 274 kwargs =
dict(shared_size=self.block_size*self.dtype_out.itemsize)
275
276 #print block_count, seq_count, self.block_size, sz
TypeError: unsupported operand type(s) for *: 'int' and 'getset_descriptor'
WARNING: Failure executing file: <reduction.py>
Is this a numpy version incompatibility?
Any ideas?
Thanks a lot.
Bruno
_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda