pyopencl
pyopencl copied to clipboard
missing example for using vector types defined in cltypes
Looks like there's no example using vector types defined in cltypes while the doc itself for these types are not so understandable. There are many examples having kernels taking vector type arguments, but the python code is using the numpy
type, instead of the defined vector type. E.g. https://github.com/inducer/pyopencl/blob/master/examples/demo_elementwise_complex.py
I'm having a hard time understanding what you're asking for. If you look at test_array.py
, you can see sample code using, e.g. cltypes.float4
. Does that help?
Right, thanks @inducer for pointing the test_array.py
. This is the kind of example I was looking for. I feel there should be documentation on the vector types. Functions like cltypes.make_float4
is very useful but I couldn't see it anywhere nor in the examples.
Could you draft a PR that improves the documentation in the way you're suggesting?
I can do it after I have more free time later :) (working on conference deadline now)