Alternatively, I could split my struct into the array of the field
which max() is sought and the array of the remaining fields. But then
could ReduceKernel be made to return the _position_ and not the value?
I'd use it to retrieve all the values from the both arrays.
Igor


On Wed, Nov 16, 2011 at 9:38 PM, Igor <[email protected]> wrote:
> Either I'm doing something wrong or indeed it's by design that I can't
> use custom struct-types with ReductionKernel? How do I proceed?
> Igor
>
>
>
> Fxy= [('f','double'), ('i', gpuarray.vec.int2)]
>
> max = ReductionKernel(dtype_out=Fxy, neutral="0",
> reduce_expr="max(a.f,b.f)", map_expr="a[i]", arguments="Fxy *x")
>
>
>
>
>
> Traceback (most recent call last):
> ...
>
>  File 
> "/usr/local/sage/sage-test/sage-4.7.1/local/lib/python2.6/site-packages/pycuda-2011.1.2-py2.6-linux-x86_64.egg/pycuda/reduction.py",
> line 187, in __init__
>    dtype_to_ctype(dtype_out), self.block_size,
>  File 
> "/usr/local/sage/sage-test/sage-4.7.1/local/lib/python2.6/site-packages/pycuda-2011.1.2-py2.6-linux-x86_64.egg/pycuda/tools.py",
> line 399, in dtype_to_ctype
>    raise ValueError, "unable to map dtype '%s'" % dtype
> ValueError: unable to map dtype '[('f', '<f8'), ('i', [('x', '<u4'),
> ('y', '<u4')])]'
>

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

Reply via email to