Bogdan Opanchuk
2014-05-21 05:16:11 UTC
Hello,
Does PyCUDA support struct arguments to kernels? From the Python side
it means an element of an array with a struct dtype (a numpy.void
object), e.g.
dtype = numpy.dtype([('first', numpy.int32), ('second', numpy.int32)])
pair = numpy.empty(1, dtype)[0]
See https://gist.github.com/Manticore/15383a1ae367bfc6efe8 for an
example of the functionality in question. It fails on ``get_second()``
call complaining about the second argument (the structure).
An analogous code in PyOpenCL works fine, but as far as I understand
from its source, it uses a somewhat different mechanism of argument
passing as compared to what is employed by PyCUDA.
Best regards,
Bogdan
Does PyCUDA support struct arguments to kernels? From the Python side
it means an element of an array with a struct dtype (a numpy.void
object), e.g.
dtype = numpy.dtype([('first', numpy.int32), ('second', numpy.int32)])
pair = numpy.empty(1, dtype)[0]
See https://gist.github.com/Manticore/15383a1ae367bfc6efe8 for an
example of the functionality in question. It fails on ``get_second()``
call complaining about the second argument (the structure).
An analogous code in PyOpenCL works fine, but as far as I understand
from its source, it uses a somewhat different mechanism of argument
passing as compared to what is employed by PyCUDA.
Best regards,
Bogdan